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

Can we execute a program without main() method?

535


What is Classloader in Java?

639


What is the covariant return type?

580


Explain tree set and its features?

599


How do you add an element to an arraylist in java?

489






Does sprintf add a null terminator?

565


4.1 Supply contracts (in the form of comments specifying pre- and post conditions) for the enqueue() method of the LinkedQueue class given in the Appendix. (2) 4.2 Let Thing be a class which is capable of cloning objects, and consider the code fragment: Thing thing1 = new Thing(); //(1) Thing thing2 = thing1; //(2) Thing thing3 = (Thing) thing1.clone(); //(3) Explain how the objects thing2 and thing3 differ from each other after execution of the statements. (

1417


What is difference between module and function?

542


How is a variable stored in memory?

531


Can we declare the static variables and methods in an abstract class?

549


What is an iterator interface in java programming?

540


How does map works in java?

519


What is rmi and steps involved in developing an rmi object?

570


What are the different types of data structures in java?

493


What is the purpose of static keyword in java?

519