What is meant by vector class, dictionary class , hash table class,and property class ?

What is meant by vector class, dictionary class , hash table class,and property class ?

Vector is a array whose size can be grown or shrink. Allows duplicate elements.
It is an ordered collection based on index.
Vector is a class of List Interface which is from collection framework.
Allows any number of null values.
By default, vector elements are not sorted.
It is a synchronized collection (thread-safe), since it is a legacy class.
Stack is sub class of Vector.
Dictionary is an abstract class.
Hash table and property are inherited from Map interface which is not derived from collection interface. Based on hashing mechanism.
Keys cannot be duplicated but values can be duplicated.
Both keys and values are unordered i.e., the entries in Hashtable are unordered.
Neither key nor value is null.
By default, hashtable entries are not sorted.
By default, Hashtable is a synchronized Map.
Properties are usually configured in property file with .properties extension.
The entries in property file are key, values and separated with equal (=) symbol.
Though the Properties class is inherited from Hashtable, but both keys and values must be string objects only.
The advantages of using properties file is, the changes can be made in one place, which are reflected across all other placess in our code.

By:Sumit Tripathi
Date:2022-05-15 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related Java Subjective Links

Java Subjective interview questions and answers for experienced and fresher