Java Set Interface And Methods

Set is one of the collection framework interface which extends root Collections interface. Set collection can not contain duplicate elements. Set interface has all methods which are inherited from Collection interface with special restriction of not allowing duplicate elements. If two Set interface contains same elements then both are equal. Set interface is implemented by … Read more

Java Queue Interface

If you look at collection hierarchy, Queue extends collection interface. Main purpose of collection is to hold the elements prior to processing. Queue interface provides some additional operations like insertion, inspection and extraction besides collection interface operations. All these three operations exist in 2 different forms. One return special value(null or false depending on the operation) … Read more

Stack Class in Java Example

Stack class in java is one of the collection interface class which is subclass of Vector class. Stake class supports usual push and pop operations. In contrast to queue, Stack class has last-in first-out(LIFO) data structure. So item which is inserted at top will be available first. Stack class extends Vector class of List interface … Read more

Vector Class In Java

Vector class in java implements List interface of collection framework. Vector class is synchronized. If you don’t know size of array then you can use vector class as size of vector can grow and shrink as per adding and removing items. As vector class is synchronized, It will give poor performance on add, delete, update … Read more