Java - How to create and initialize a List ArrayList in efficient way 30975
Here are some better way to Create and initialize a ArrayList or List in Java. These are convenient methods if you want to initialize the list with fixed set of elements.
Working with Date and Time API - Java 8 Feature 8760
A new java.time package is introduced in Java SE 8 for date and time handling. Let us try to understand that what are new features and why a separate API was required for date and time handling..
RESTful web-service to get and search States and territories of a Country 156907
Here is a RESTful web service to get and search states and territories of a country. This web service can be used for testing, learning or can be consumed for any web application.
Lambda expression is the one of major change in Java 8.0 after Generics, Annotations in Java 5.0. Lambda expressions are anonymous method similar to anonymous classes in Java.
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 20056
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.