Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the difference between set and list?

Answer Posted / sumit

set-->
when uniqueness is required you need to implement set.
e.g.
HashSet(unOrd,unSort) Fast access, assures no duplicates,
provides no ordering.
LinkedHashSet(Ord,unSort)No duplicates; iterates by
insertion order.
TreeSet(ascending,naturalord)No duplicates ; iterates in
sorted order.

list-->
when ordered list is required you need to implement list.
e.g.
ArrayList(Ord,unSort)Fast iteration and fast random access.
Vector(syncronized)
LinkedList()Good for adding elements to the ends, i.e.,
stacks and queues.

Is This Answer Correct ?    91 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a program to find the whether a number is an Armstrong number or not?

1034


What are the problems faced by java programmers who don't use layout managers?

985


What does math floor () do?

972


What is a class variable?

1055


What do you understand by garbage collection in Java? Can it be forced to run?

989


What is function and its uses?

1127


What does java ide mean?

1150


What happens if an exception is not handled in a program?

1108


What is the implementation of destroy method in java. Is it native or java code?

975


What is meant by class loader? How many types are there? When will we use them?

973


Explain where variables are created in memory?

1018


What is the exact difference in between Unicast and Multicast object? Where will it be used?

1064


Why stringbuilder is not thread safe in java?

1019


What is lazy initialization in java?

1019


Why lambda expression is used in java?

1071