LinkedList and ArrayList both are ordered collections and implements List interface. These two Arraylist and linkedlist implementation has their own advantage and disadvantages and should be used based on the need. Here is a comparison and difference between these two implementations.
Loops are one of most expensive part of a program. If there are any unnecessary statement inside the loop, it may reduce the performance. There are various points if we care, while coding then we can improve the performance. The main focus area of optimization is to fine-tune conditions, use fast operators, object creations etc.
How to serialize and deserialize Java Object to XML using Xstream 3365
Many times we need to convert a Java object to XML string or xml string to object, in that case Xstream is good choice specially if we are working with third party Java classes where we don't have source of class to change.