Java 6 introduces new collection APIs.
Java 6.0 includes several Application Programming Interfaces (APIs), as well as numerous changes to existing classes, particularly collection APIs. The modifications to the collection framework are summarised below.
New User Interfaces
About
BlockingDeque
NavigableSet
NavigableMap
New Courses
ArrayDeque
LinkedBlockingDeque
ConcurrentSkipListSet
ConcurrentSkipListMap
AbstractMap.SimpleEntry
AbstractMap.SimpleImmutableEntry
Classes have been updated.
LinkedList
TreeSet
TreeMap
Collections
ArrayDeque and Deque
Double Ended Queue is abbreviated as Deque. It is a collection that enables the addition and removal of components from both ends. Deque implementations may be used as a Stack or a Queue. The insertion and removal methods in Deque implementations are of two types: one throws an exception to signal a failed operation, while the other returns a specific value as an indication, in this instance we frequently use null to indicate that the collection is empty. As a result, the insertion of null values must be prevented. Want to do react js course and training in Delhi? Visit here for all the information related to it: https://www.tgcindia.com/course/adv-certification-in-reactjs-for-web-design/
ArrayDeque
ArrayDeque is one of the Deque implementations. It has the following characteristics:
There are no capacity limitations.
When used as a stack and queue, it is faster than a stack and a linked list.
ArrayDeque is not considered thread-safe.
LinkedBlockingDeque and BlockingDeque
BlockingDeque offers qualities similar to Deque but with some extra capabilities. If we attempt to insert an element into an already full BlockingDeque, it will wait for the space to become available before inserting the provided element. The developer may set the time limit for waiting. There are four kinds of blockingDeque insertion and removal procedures.
Exception-throwing methods
Methods that return unique values
Methods that wait endlessly for insertion space to become available
Methods that wait for a certain amount of time for space to become available for insertion.
ConcurrentSkipListSet and NavigableSet
The closest matches of a given element for items in the collection are returned by NavigableSet methods. Lower, floor, ceiling, and higher NavigableSet methods return items less than, less than or equal to, more than or equal to, and greater than of a specified element, respectively. If there is no such element, it returns null. NavigableSet may be accessed and navigated both ways. ConcurrentSkipListSet is one of the NavigableSet implementations.
ConcurrentSkipListMap and NavigableMap
It's comparable to NavigableSet, which is used to hold key-value pairs. ConcurrentSkipListMap is one of the NavigableMap implementations.
AbstractMap.SimpleEntry and AbstractMap.SimpleImmutableEntry
These are the static classes included inside the abstract map class that is used to store key-value pairs. The distinction between these two classes is that AbstractMap is a class. While the AbstractMap, SimpleEntry allows programmers to set the value using the setValue method. If we attempt to set the value, SimpleImmutableEntry raises an UnsupportedOperationException. For mean stack training in delhi related information go through this link: https://www.tgcindia.com/course/adv-certification-course-in-mean-stack-developer/
Classes have been modified.
There are a few modifications in Java 6 collections, such as LinkedList being updated to implement Deque, TreeSet being modified to implement NavigableSet, and TreeMap being modified to implement NavigableMap.
Java6.0's new capabilities enable programmers to provide simpler retrieval of items in the appropriate manner.
0コメント