What is the Properties Class

The properties class is a subclass of Hashtable that can be read from or written to a stream. It also provides the capability to specify a set of default values to be used. In Core Java, the Properties class is a class that represents a persistent set of properties, which can be loaded from or … Read more

What is Difference Between Iterator and Enumeration

Both Iterator and Enumeration are used to traverse Collection objects, in a sequential fashion. Enumeration can be applied to Vector and HashTable. Iterator can be used with most of the Collection objects. The main difference between the two is that Iterator is fail-safe. i.e,  If you are using an iterator to go through a collection … Read more

What is Enumeration in Java

An enumeration is an object that generates elements one at a time, used for passing through a collection, usually of unknown size. The traversing of elements can only be done once per creation. In Java, the term “Enumeration” usually refers to the legacy interface java.util.Enumeration. This interface was part of the original Java Collections Framework and … Read more

Difference Between Vector and ArrayList

Vector & ArrayList both classes are implemented using dynamically resizable arrays, providing fast random access and fast traversal. ArrayList and Vector class both implement the List interface. Synchronization – ArrayList is not thread-safe whereas Vector is thread-safe. In Vector class each method like add(), get(int i) is surrounded with a synchronized block and thus making Vector … Read more

What is ArrayList In Java

ArrayList is a part of the Collection Framework. We can store any type of objects, and we can deal with only objects. It is growable In Java, an ArrayList is a part of the Java Collections Framework and is implemented in the java.util package. It is a dynamic array that can grow or shrink in … Read more