Describe the java collections framework? , JAVA Programming

Assignment Help:

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.

 


Related Discussions:- Describe the java collections framework?

Explain the order of evaluation of logic operators, Explain the Order of Ev...

Explain the Order of Evaluation of Logic Operators ? When Java sees a && operator or a ||, the expression on the left side of the operator is evaluated first. For instance, con

Design the complete user interface of the simulation, Task 1- Design the co...

Task 1- Design the complete user interface of the simulation. Task 2 -Design the record structures of the text files that are required to drive the working simulation. Populate

Which models are supported by jms, Which models are supported by JMS? Pleas...

Which models are supported by JMS? Please, explain them. Ans) Publish or subscribe (pub/sub). This model permits a client (publisher) to send messages to a JMS topic. These mess

Write a singleton program?, Having one instance overall the application.eg....

Having one instance overall the application.eg.: Loggers

What will be the output of given program, What will be the output of this p...

What will be the output of this programme? Write comments where you find "//" symbol in the following code? function doSomething() { // 1 setTimeout('doSomething()',10000

Java program need to compile, Java program need to compile Project Descr...

Java program need to compile Project Description: i have one program required to compile to run it . Skills required: Java

How to creating arrays in java, How to Creating Arrays in java? Declari...

How to Creating Arrays in java? Declaring arrays merely says what type of values the array will hold. It does not form them. Java arrays are objects, and such as any other obje

Minimum shelfs, send me the java code for minimum shelf program

send me the java code for minimum shelf program

What are inner beans, When wiring beans, if a bean element is embedded to a...

When wiring beans, if a bean element is embedded to a property tag directly, then that bean is said to the Inner Bean. The disadvantage of this bean is that it cannot be reused any

What is meant by weaving, The process of applying aspects to a target objec...

The process of applying aspects to a target object to form a new proxy object is known as Weaving. The aspects are woven into the target object at the verified join points.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd