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
Whatsapp bulk messenger to unlimited numbers Project Description: Develop a desktop application or script solution to bulk whatsapp sms without getting any block from the wha

Write a Java application to simulate a bank system. In the system, customers can open new bank accounts with the bank, and register/use an online account to manage their bank accou

implement simulated annealing for cable company problem

Define the key weakness of the web? the key weakness of the web is Initially web was designed only for humans to read not for computers to understand it.

REQUIREMENT: We are seeking a simple tool that will convert an existing flash file (.SWF) into HTML5. Our purpose is to convert small flash games into html5 games. Please NOTE: We

Java coding required Project Description: Need to develop a website. Require Java coders urgently. Skills required are Graphic Design, HTML, PHP, Java, Website Design

any one out there with Boggle Source code?......i really need it guys please.

Im not in the line of computer science.But i would like to have some knowledge about the computer language "JAVA".I aldredy learns the computer languages "C,C++".So kindly help me

Development of an Android app urgent Project Description: I am searching for some good android developer who has depth in knowledge of making an app. I am focusing on a certa

In pre-emptive scheduling, the highest priority task implements until it enters the waiting or dead states or a higher priority task comes into existence. In time slicing, a tas