What is the difference between set and list?

Answer Posted / vinod varma

set is an interface which doesnot allows the duplicate values
where as list is also an interface which allows the
duplicate values and we may not guarantee the order of
elements in set
but we can get the elements from list according to their
indexes. we may not insert the elements into set at the
specific index, but possible in list.

Is This Answer Correct ?    11 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you escape sequences in java?

583


What is the difference between compile-time polymorphism and runtime polymorphism?

555


What is overloading and overriding in java?

651


Is Java a dying language?

562


What is percentage in java?

561






Difference between process and thread?

595


What is the static import?

573


What are thread groups?

566


What's the base class of all exception classes?

557


How to find the index of the largest number in an arraylist java?

507


What is final keyword in java?

547


How does list work in java?

498


Explain listiterator and methods in listiterator?

539


Can we make a constructor final?

531


What are serialization and deserialization?

713