Templates by BIGtheme NET

Guave Collections

Some important collections in Guava,
1) Immutable collections
2) New collection types (Multiset, Multimap, BiMap, Table, ClassToInstanceMap and RangeSet)
3) Utility Classes (Iterables, Lists, Sets, Maps, Multisets, Multimaps and Tables)
4) Extension Utilities (Forwarding Decorators, PeekingIterator and AbstractIterator)

1) Immutable collections :
Immutable objects have many advantages,
1) Safe for use by untrusted libraries.
2) Thread-safe: can be used by many threads with no risk of race conditions.
3) All immutable collection implementations are more memory-efficient than their mutable siblings.
4) Can be used as a constant, with the expectation that it will remain fixed.

Making immutable copies of objects is a good defensive programming technique.

Some comparison between JDK With Guava,

*** Venkat – Happy leaning ****