Describe the java collections framework? , JAVA Programming

Comparable interface: The "Comparable" allows itself to compare with other same types of object. The function compareTo() is specified in the interface.

Several of the standard classes in the Java library like String, Date, Integer, File etc implement the Comparable interface to provide the class a "Natural Ordering".

 For example String class describes the following methods:

public int compareTo(o)

public int compareToIgnoreCase(str)

 

Comparator interface: The Comparator is needed to compare two distinct objects. The following function is specified in the Comparator interface.

public int compare(Object l1, Object l2)

 

606_Untitled.png

 

 

There are the benefits of the Java Collections Framework.

Java Collections framework gives performance, flexibility, and robustness.

1. Polymorphic algorithms - sorting, binary search, reversing, shuffling etc.

2. Set algebra - such as finding subsets, unions, and intersections between objects.

3. Performance - collections have much better performance compared to the Hashtable classes and older Vector with the elimination of synchronization overheads.

4. Thread-safety - when synchronization is needed, wrapper implementations are gives for temporarily synchronizing existing collection objects.

5. Immutability - when immutability is needed wrapper implementations are given for building a collection immutable.

6. Extensibility - abstract classes and interfaces give an excellent starting point for adding functionality and features to prepare specialized object collections.

 

Posted Date: 7/25/2012 1:32:11 AM | Location : United States







Related Discussions:- Describe the java collections framework? , Assignment Help, Ask Question on Describe the java collections framework? , Get Answer, Expert's Help, Describe the java collections framework? Discussions

Write discussion on Describe the java collections framework?
Your posts are moderated
Related Questions
Information Retrieval during Multi-Agent System with Data Mining in Cloud Computing Project Description: I have proposed one research model on "Information Retrieval during M

what is thread?

Explain DATA SECURITY Management issue? All data in the system is extremely critical to its operation, the security of the customer's personal data is most important. Most of t

how to write bank system

Distributed / Network Oriented Java is network friendly -- both in its portable, threaded nature, and since common networking operations are built-in to the Java libraries.

how to give dataset to a decision tree which is written by java using weka software?

write a program that counts the number of occurrences of the string in the n-th Padovan string P(n).   program in java // aakash , suraj , prem sasi kumar kamaraj college

Normal 0 false false false EN-US X-NONE X-NONE

You are a newly recruited programmer, working for an IT company. This company won a contract to develop a Customer Relationship Management System (CRM) for a major retailer. The CR

Explain The different kinds of exceptions ? Checked Exceptions  : Environmental error in which cannot necessarily be detected through testing; e.g. broken socket, disk full,