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?

Implementation of function, Suppose that: A is the set of characters in ...

Suppose that: A is the set of characters in the string "pellet"; B is the set of characters in the string "teller"; C is the set of characters in the string "pertinent"; a

Area under curves, Write a program to find the area under the curve y = f(x...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

Calculate the kilometer within an hour, Calculate the kilometer within an h...

Calculate the kilometer within an hour? class Car { String licensePlate = ""; // e.g. "New York 543 A23" double speed = 0.0; // in kilometers per hour doubl

Luminous jewels, Luminous Jewels - The Polishing Game Byteland county is v...

Luminous Jewels - The Polishing Game Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various lum

Multithreading and networking, This assignment has two main objectives. It ...

This assignment has two main objectives. It aims to establish a basic familiarity with the Java API (Java Thread class) for creating multithreaded Java application, and the Java ne

Task priority and uses in scheduling, What do you mean by a task's priorit...

What do you mean by a task's priority and how can we use it in scheduling ?

Expertise in gps or navigation app coding, Project Description: Two co-f...

Project Description: Two co-founders are in search of a developer to join us to launch a tech startup. We have experience at fortune 500 companies, elite consulting firms, etc.,

Object-based programming, JavaScript is an extremely powerful object-based ...

JavaScript is an extremely powerful object-based (or prototype-based) language. It is not a full-blown OOP (Object-Oriented Programming) language, like Java, however it is an objec

Write html and javascript code for the needs, Write HTML and JavaScript cod...

Write HTML and JavaScript code for the needs shown in the diagram below? When ConvertoUpperCase button is pressed then the entered text is converted to upper case and result is

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