Explain hashset and its features?



Explain hashset and its features?..

Answer / Anita Devi

A HashSet in Java is a set implementation that uses a hash table for faster lookups. Its main features include: 1) It does not allow null elements (neither keys nor values). 2) It maintains no particular order of elements. 3) It provides constant-time average performance for basic operations (O(1) for add, remove, and contains).

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

How can we avoid including a header more than once?

1 Answers   Fidelity,


what is the significance of listiterator in java?

1 Answers   IBS,


When will we use class loader?

2 Answers  


Consider that class classA, abstract class classB, and final classC have been defined.Which one of the following is correct? 1. classA extends classC implements classB 2. class A extends classB, classC 3. classA extends classB 4. classB implements classC

2 Answers  


What are three ways in which a thread can enter the waiting state in java programming?

1 Answers  


What is difference between static class and singleton pattern?

1 Answers  


What is method Overloading in the perspective of OOPS?

6 Answers  


IS method overriding is Duplication of Methods?

5 Answers   CybAge,


how would you implement a thread pool? : Java thread

1 Answers  


What is Generic in java? Where can we write Generic ( class or method or objects or etc...)? with simple example? Thanks, Bose.

2 Answers   Infosys, Tech Mahindra,


How do you classify Dialog Box?

1 Answers   CGI,


How dead lock situation occurs in java and how you can identify it?

1 Answers  


Categories