☕️JAVA Language Community
2.91K subscribers
144 photos
7 videos
31 files
42 links
☕️ Software, IT, Java, news
💻 IT highlights
🎯 AI update
🖥⌨️🖱
Download Telegram
#Java_Interview_Question

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☕️
#Java_Interview_Question

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☕️
#Java_Interview_Question

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☕️
👍1