Set in Java

Set in Java Set interface is an unordered collection of elements but you can’t store duplicate values in Set.It does not maintain the insertion order.To use the set, we can use 4 classes. 1)HashSet 2)LinkedHashSet 3)EnumSet 4)TreeSet We can create the implementation object for any of above classes: HashSet: If we don’t care about the … Read more

Understanding ArrayList in Java (With Examples)

ArrayList in Java ArrayList provides the dynamic array for storing the elements. ArrayList is a class in Java collection framework.It comes under java.util package. Need for ArrayList: We use ArrayList when we need to do lot of modifications to the elements. Feature of ArrayList: 1)ArrayList is similar to Array but there is no limit on … Read more