Explain the both hashset and treeset, JAVA Programming

Assignment Help:

Explain the both HashSet and TreeSet?

HashSet is an unordered, unsorted Set.

It's a Collection set which restrict duplicate elements and also repositioning of elements.

It implements Set interface and extends AbstractSet.

Uses hash code of object being inserted.

TreeSet is a Set implemented when we want elements in a sorted order.

Sorting of element is done according to natural order of elements or by help of comparator provided at creation time.

 


Related Discussions:- Explain the both hashset and treeset

Inheritance, Your task for this assignment is to define multiple classes vi...

Your task for this assignment is to define multiple classes via inheritance. Your classes should implement various "snacks" including "M&Ms", "Popcorn", etc. To begin, create an a

Java pass arguments by value or reference, Does Java pass arguments by valu...

Does Java pass arguments by value or reference? Ans) Pass by value. 1. When passing primitives, it going a copy of the variable to the method. Any change made in the method d

Change to palindrome, A palindrome is a string that reads the same from bot...

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Concurrent Programming, Problem 1 A savings account object holds a non-nega...

Problem 1 A savings account object holds a non-negative balance, and provides deposit(k ) and withdraw(k ) methods, where deposit(k ) adds k to the balance, and withdraw(k ) subtra

Explain role of actionservlet , ActionServlet performs the role of Contro...

ActionServlet performs the role of Controller: ? Process user requests ? Verify what the user is trying to achieve according to the request ? Pull data from the model (if

Describe the class or static members, Describe the Class or static Members ...

Describe the Class or static Members ? A method or a field in a Java program could be declared static. That means the member belongs to the class rather than to an individual

Explain declaring- allocating and initializing two dimension, Explain the f...

Explain the following terms declaring, Allocating and initializing two dimensional array? Two dimensional arrays are declared, allocated and initialized much such as one dimens

What is constructors and explain with an example, What is Constructors? Exp...

What is Constructors? Explain with an example? A constructor forms a new instance of the class. It initializes all the variables and does any work essential to prepare the clas

Malformedurlexception and unknownhostexception, When MalformedURLException ...

When MalformedURLException and UnknownHostException throws? Ans) When the particular URL is not connected then the URL throws MalformedURLException and If InetAddress? methods g

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