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?

Starting in new app, iam trying to build an application that store informat...

iam trying to build an application that store information like name mobile age in a file its like a registration form everytime i enter a new person data i want the applicaion mak

Convert an existing flash file into html5, REQUIREMENT: We are seeking a si...

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

Calculate Bill program, Notice that each row now has the type of customer a...

Notice that each row now has the type of customer and the additional data needed. calculateBill remains the same in Customer.  However, the calculateBill in Corporate will add a

Reading or writing disk files, For this assignment, you will simulate a fil...

For this assignment, you will simulate a file system. You will be neither creating files nor reading or writing disk files. Rather, you will have a simulation of a file system that

Message "the quick brown fox jumps over the lazy dog"., public class Concat...

public class ConcatDemo { public static void main(String[] args) { String animal1 = "quick brown fox"; String animal2 = "lazy dog"; String article = "the";

Explain break statement in a loop, Explain break statement in a loop ? ...

Explain break statement in a loop ? A break statement exits a loop before an entry condition fails. For instance, in this variation on the CountWheat program an error messa

Develop an android app for me, Project Description: I need someone to pr...

Project Description: I need someone to prepare an android app for me and provide it to me asap. The app details to be provided on pm Skills required: Java, Android

Prepare simple spring maven task, Prepare Simple spring maven task Proje...

Prepare Simple spring maven task Project Description: We want a very simple delivery for one of our tasks using Spring STS Maven project. This chat does not have UI interf

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