I have updated in http://www.freejavaclass.com/
Collection is a group of objects treated as single unit. Arbitrary objects can be add, delete and modified as element in collection. Java designs frequently handling group of elements as collection. The key interfaces used by the collection framework are List, Set and Map. The List and Set extends the Collection interface.
A Set is a collection with unique elements and prevents duplication within the collection. HashSet and TreeSet are implementations of a Set interface. A List is a collection with an ordered sequence of elements and may contain duplicates. ArrayList, LinkedList and Vector are implementations of a List interface.
The Collection API also supports maps, but within a hierarchy distinct from the Collection interface. A Map is an object that maps keys to values, where the list of keys is itself a collection object. A map can contain duplicate values, but the keys in a map must be distinct. HashMap, TreeMap and Hashtable are implementations of a Map Interface.
Collection framework provides flexibility, performance, and robustness.
• Polymorphic algorithms – sorting, shuffling, reversing, binary search etc.
• Set algebra - such as finding subsets, intersections, and unions between objects.
• Performance - collections have much better performance compared to the older Vector and Hashtable classes with the elimination of synchronization overheads.
• Thread-safety - when synchronization is required, wrapper implementations are provided for temporarily synchronizing existing collection objects.
• Immutability - when immutability is required wrapper implementations are provided for making a collection immutable.
• Extensibility - interfaces and abstract classes provide an excellent starting point for adding functionality and features to create specialized object collections.
Subscribe to:
Post Comments (Atom)
How can instantiate Java interface without implementing.
public interface Foo { String method(); } public class Claaa { public static void main(String[] args) { Foo fooByIC...
-
1) Download docker for windows and don't install. 2) Restart the machine and enable "Virtualilaization" in BIOS settings 3) ...
-
http://freejavaclass.com/articles/j2ee/hibernate/multiple_persistence_unit_in_jpa.jsp
-
I have updated in http://www.freejavaclass.com/ final : final keyword can be used for class, method and variables. A final class cannot b...
No comments:
Post a Comment