#Java_Interview_Question
139) What is the difference between List and Set?
List can contain duplicate elements whereas Set contains only unique elements.
@javaCode☕️
139) What is the difference between List and Set?
List can contain duplicate elements whereas Set contains only unique elements.
@javaCode☕️
👍1
#Java_Interview_Question
140) What is the difference between HashSet and TreeSet?
HashSet maintains no order whereas TreeSet maintains ascending order.
@javaCode☕️
140) What is the difference between HashSet and TreeSet?
HashSet maintains no order whereas TreeSet maintains ascending order.
@javaCode☕️
#Java_Interview_Question
141) What is the difference between Set and Map?
Set contains values only whereas Map contains key and values both.
@javaCode☕️
141) What is the difference between Set and Map?
Set contains values only whereas Map contains key and values both.
@javaCode☕️
👍2
#Java_Interview_Question
142) What is the difference between HashSet and HashMap?
HashSet contains only values whereas HashMap contains entry(key,value). HashSet can be iterated but HashMap need to convert into Set to be iterated.
@javaCode☕️
142) What is the difference between HashSet and HashMap?
HashSet contains only values whereas HashMap contains entry(key,value). HashSet can be iterated but HashMap need to convert into Set to be iterated.
@javaCode☕️
#Java_Interview_Question
143) What is the difference between HashMap and TreeMap?
HashMap maintains no order but TreeMap maintains ascending order.
@javaCode☕️
143) What is the difference between HashMap and TreeMap?
HashMap maintains no order but TreeMap maintains ascending order.
@javaCode☕️
#Java_Interview_Question
144) What is the difference between HashMap and Hashtable?
1) HashMap is not synchronized. Hashtable is synchronized.
2) HashMap can contain one null key and multiple null values.
@javaCode☕️
144) What is the difference between HashMap and Hashtable?
1) HashMap is not synchronized. Hashtable is synchronized.
2) HashMap can contain one null key and multiple null values.
@javaCode☕️
👍1
#Java_Interview_Question
145) What is the difference between Collection and Collections?
Collection is an interface whereas Collections is a class.
Collection interface provides normal functionality of data structure to List, Set and Queue.
But, Collections class is to sort and synchronize collection elements.
@javaCode☕️
145) What is the difference between Collection and Collections?
Collection is an interface whereas Collections is a class.
Collection interface provides normal functionality of data structure to List, Set and Queue.
But, Collections class is to sort and synchronize collection elements.
@javaCode☕️