How to declare unique ArrayList ?

Answer Posted / kiran

you have SET INTERFACE in COLLECTION in java . where u can
store unique elements and if u try to add duplicate elements
it will raise an error

Is This Answer Correct ?    10 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to sort an array from smallest to largest java?

550


What java is used for?

670


What is the difference between procedural and object-oriented programs?

536


What is linked hashmap and its features?

555


What are data types in programming?

559






Is set sorted in java?

527


What does \ mean in regex?

632


What are internal and external variables?

552


How we can declare a static variable?

661


Is char a data type in java?

552


How do you identify if jvm is 32-bit or 64-bit from java program?

546


What are the concepts of 'OOPS'?

609


What is the difference between comparison done by equals method and == operator?

582


Can a method be static?

530


Why is stringbuffer not immutable?

578