what is difference between set and list in collection?

Answer Posted / srinu

set:
1)set interface extended from collection interface
2)set does not allow duplicated values
3)set interface contain concreated classes(TreeSet,HashSet)
4)set interface retrive the data only forward Direction
only( only Iterator is their)
5)in set object add an element at end only
6)set interface contain one sub interface(sorted set)

List
1)List interface extended from collection interface.
2)List allows duplicated values
3)List interface contain concreated
classes(ArrayList,LinkedList)
4)in List object add an element at specific(dynamic)
insertion is possible
5)List interface retrive the data forward Direction and
backword directions(ListIterator is their)
6)List interface does not contain ony sub interface

Is This Answer Correct ?    36 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we clone singleton class in java?

530


Why java is used everywhere?

599


Can bool be null?

530


What is e in java?

551


List the three steps for creating an object for a class?

523






How do I print a “?

585


How do you remove an object from an arraylist in java?

469


What is abstraction in java?

621


Is set ordered?

548


What is a static class in java?

566


Explain about anonymous inner classes in java?

586


What is garbage collection? What is the process that is responsible for doing that in java?

670


23. Storage space in java is of the form Stack Queue Heap List 24. What is java code embedded in a web page known as Applets Servlets scriptlets snippets 25. Which of the following attributes are compulsory with an tag?. code,height & width. 26. What does 'CODEBASE' in an applet tag specify?. Files absolute path.

2063


What do you mean by local class?

523


What is Hierarchy of exception?

655