Java Interview Questions

Set Interface in Java – HashSet , SortedSet Interface , LinkedHashSet

Being a child Interface of Collection Interface, we will use Set when we want to represent a group of individual objects as a single entity, where no duplicate elements are allowed and insertion order is not preserved. Being a child interface of Collection Interface, all methods declared in Collection Interface are by-default available in Set (Interface). …

Set Interface in Java – HashSet , SortedSet Interface , LinkedHashSet Read More »

List Interface in Java – Free Java Tutorials and Online Training

List Interface is a child interface of Collection Interface. We will go for List Interface if we want to represent a group of individual objects as a single entity where duplicates are allowed and the insertion order must be preserved. Say, the above list (may be ArrayList or LinkedList) contains 6 elements, the elements in …

List Interface in Java – Free Java Tutorials and Online Training Read More »

Collection Interface in Java – Free Java Tutorials

If we want to represent a group of individual objects as a single entity, then we should go for Collection Interface. Collection Interface defines the most common methods which are applicable for any Collection object like LinkedList, ArrayList etc. Collection Interface Methods These methods are declared inside Collection (Interface): add(Object obj) : This method we …

Collection Interface in Java – Free Java Tutorials Read More »