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


Please Help Members By Posting Answers For Below Questions

What is the generic class?

540


What are keywords give examples?

588


what is inner class in java?

628


Is java ee a framework?

531


Explain the importance of join() method in thread class?

650






Difference between keyword and identifier.

605


What is generics in java interview questions?

549


what is instanceof operator used in java?

599


Does isempty check for null?

573


Tell some latest versions in JAVA related areas?

567


Is sizeof a preprocessor?

555


What is the difference between arraylist and hashset in java?

527


What are voids?

547


What is a singleton puppy?

543


List out five keywords related to exception handling ?

608