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

What is sorting in java?

627


What happens if an exception is throws from an object's destructor?

675


Why stringbuffer is faster than string?

657


Is a method a procedure?

651


How much is a java license?

606






Can we sort a map in java?

669


What is a top level class in java?

619


How do you do a line break in java?

574


Difference between collection, collection and collections in java?

658


Can java object be locked down for exclusive use by a given thread?

675


What is the core java?

628


Can an unreferenced object be referenced again?

834


What is classname class in java?

631


How do you format in java?

650


What are three advantages of using functions?

642