Showing posts with label ArrayList. Show all posts
Showing posts with label ArrayList. Show all posts

Removing null elements from List in Java

In this tutorial lets see how to remove null elements from the given list by using java Collections. Basic we could think iterating through List and to delete all null elements. But by using...

How to convert list to read-only list in Java?

By using Collections class we can convert List to read-only List. This can done by using Collections.unmodifiableList(list) function from Collections class. By this we can't add or remove any element from the List. Not...

Difference between ArrayList and Vector in Java

ArrayList and Vector are the important collection classes which used in Java. And also widely asked in interview about their difference and similarities between these 2 classes. Before looking into the difference and similarities between these...

Vector and ArrayList

In this tutorial we will see about Vector and ArrayList in java. Both Vector and ArrayList shares common data structure "Array" internally. Synchronized and non-synchronized By default Vector is Synchronized and ArrayList is not...