Home » #collectionFramework

#collectionFramework

Collection

51 What is a weak HashMap?An implementation of the map interface, which includes only weak references to the keys. This allows garbage collection when the key is no longer referenced outside of the Map. 52. Why concurrentHashMap is not used over HashMap?This is because it doesn’t perform well in a multithreaded environment. 53. How to […]

Collection Read More »

Collection

41. Explain important methods of LinkedList? Method Description boolean add( Object o) It is used to append the specified element to the end of the LinkedList. boolean contains(Object o) It a method that returns true if this list contains the specified element. void add (int index, Object element) Inserts the element at the specified element

Collection Read More »

Collection

11. Difference between Set and List?List is an ordered collection of elements and hence it maintains insertion order of elements while Set doesn’t maintain any ordering of the elements. List allows duplicate elements while Set doesn’t allow any elements. List is index-based, i.e.we can access elements in List based on Index, whereas we can’t access

Collection Read More »

Collection

1. What is java Collection framework and mention some benefits of it.Java 1.2 came up with Collections Framework that group all the collections interfaces, implementations and algorithms. Java Collections have come through a long way with the usage of Generics and Concurrent Collection classes for thread-safe operations. It also includes blocking interfaces and their implementations

Collection Read More »

Interview Preparation

Welcome to our comprehensive guide on Interview Preparation for Spring, Spring Boot, and Java! If you’re preparing for an interview for a Java development position or a role that involves working with Spring and Spring Boot frameworks, you’ve come to the right place. In this page, we will provide you with valuable insights, tips, and

Interview Preparation Read More »

Scroll to Top