

As a result, it mostly serves to store information that is subject to change, including usernames and passwords. What is the Properties file’s major advantage?Īnswer) The key benefit of using a properties file in Java is that any changes to those values are automatically reflected in the Java class without the need to recompile it.Every node contains two links-one that connects to the node after it and another that links to the node before it-which makes this possible. There are no references or pointers to the preceding node stored there.ĭoppelganger lists: Unlike other types of linked lists, doubly linked lists allow traversal of the data items in both directions. Each node in a singly linked list keeps a reference to the node after it in the list, as well as the contents of that node. One-way linked list: Data structures include singly linked lists. Describe how Java supports linked lists.Īnswer) Java supports the following two forms of linked lists:.Unlike the Set interface, which only permits one null value, the List interface supports an unlimited number of null values. The only legacy class in the List interface is the Vector class, while the Set interface lacks any legacy classes. In contrast to the unordered Set collection, which does not retain insertion order, the List is an ordered collection that does. The following list of distinctions between the two, nonetheless, is not exhaustive.Īnswer) While Set has unique objects, List can have duplicate pieces.


Java collections questions update#
The allowed concurrency among update operations is guided by the optional concurrencyLevel constructor argument (default 16), which is used as a hint for internal sizing.

This class is different from Hashtable in terms of locking it means that hashtable use object level lock but this class uses bucket level lock thus having better performance. In this class put and remove methods are synchronized but not get method. Ans) A concurrentHashMap is a thread-safe implementation of Map interface.
