How to declare unique ArrayList ?

Answer Posted / ballu

i think java does not this in built facility ... you would
need to make sure that objects inserted in array are unique
( by overriding equals() and hash() method of Object class

Is This Answer Correct ?    3 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by boolean?

801


How will you serialize a singleton class without violating singleton pattern?

1734


Where will it be used?

1695


What is the purpose of static methods and static variables?

745


Explain about map interface in java?

779


How does a for loop work?

728


Assume a thread has lock on it, calling sleep() method on that thread will release the lock?

869


Can you explain the meaning of aggregation and composition

756


What is javac used for?

690


what is the difference between the methods sleep() and wait()? : Java thread

720


Write a java program that prints all the values given at command-line.

747


How does hashset works in java?

739


A non-static inner class may have object instances that are associated with instances of the class’s outer class. A static inner class does not have any object instances.

754


What is parseint?

719


What is module with example?

680