1.Collections framework has something extra now, lets find out
a. Deque- if you expand it then it will be something like this
D + E +Que ==> Double + Ended + Queue =>Add or remove from either side,what an Idea sir ji :)
Its an interface known as double ended queue and extends Queue.
want to know more? ==>http://java.sun.com/javase/6/docs/api/java/util/Deque.html
b. BlockingDeque- This is little advanced Deque which will not allow deque to be
empty while retreiving data and look for space while adding data. Its again an
interface which extends Deque and BlockingQueue interfaces.
want to know more? ==> http://java.sun.com/javase/6 /docs/api/java/util/concurrent/BlockingDeque.html
c. navigableSet: As the name suggest, it will allow you to navigate in a
sortedSet. Yes it is little extra for SortedSet,it will let you find near by
element for given search targets. It lets your traverse in ascending and
descending order.
want to know more? ==> http://java.sun.com/javase/6
/docs/api/java/util/NavigableSet.html
d. NavigableMap- Its same as above for SortedMap.
want to know more? ==> http://java.sun.com/javase/6 /docs/api/java/util/NavigableMap.html
Note: LinkedList,TreeSet,TreeMap have been modified to accomodate new changes as Deque,NavigableSet and NavigableMap respectively.
2. Things which got added newly
a. ArrayDeque- A new dynamic array to support Deque,they can grow upto any size
and faster than stack and linked list if used as stack and linkedlist.
want to know more? ==> http://java.sun.com/javase/6
/docs/api/java/util/ArrayDeque.html
b. newSetFromMap(Map) - This is a powerfull method added in Collections utility
class,it lets you create one full flegded Set from a full fledged Map. No need
to iterate and do it manually.
want to know more? ==> http://java.sun.com/javase/6 /docs/api/java/util/Collections.html#newSetFromMap (java.util.Map)
The Arrays utility class now has methods copyOf and copyOfRange that can efficiently resize, truncate, or copy subarrays for arrays of all types.There are other classes and interfaces which have been added but I noted only those what we might use often.
hope it helps :)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment