Accenture NJ mostly ask question on Collection like
1)How to sort Objcts and how treeset sort them
2)Explain mechanism of Hashcode finding in Java
3)Name some of the Sorted collection.
Answer Posted / aditya sharma
1)How to sort Objcts and how treeset sort them
Ans: *) We can sort objects using comparable and comparator
interface.
*) Treeset sort object using comparable interface.
2) Explain mechanism of Hashcode finding in Java
Ans:
1) Write [ java *Class name* ] = you will get class name and
hashCode no.
2) Implement the hashCode method in your class and call
hashCode method.
3) Name some of the Sorted collection.
Ans:
1) TreeSet
2) TreeMap
Is This Answer Correct ? | 11 Yes | 0 No |
Post New Answer View All Answers
What is the generic class?
What are keywords give examples?
what is inner class in java?
Is java ee a framework?
Explain the importance of join() method in thread class?
Difference between keyword and identifier.
What is generics in java interview questions?
what is instanceof operator used in java?
Does isempty check for null?
Tell some latest versions in JAVA related areas?
Is sizeof a preprocessor?
What is the difference between arraylist and hashset in java?
What are voids?
What is a singleton puppy?
List out five keywords related to exception handling ?