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 a flag value?

519


Why string is not thread safe?

543


Why is multiple inheritance not supported in java?

561


What are the common uses of "this" keyword in java ?

569


What about abstract classes in java?

612






What is a void in java?

582


What are passing parameters?

588


What is use of super keyword in java?

597


How is tree Mirroring implemented?

631


What is local class in java?

520


Why wait(),notify(),notifyAll() methods defined in Object class althought we are using in only threads.

2372


In which order the iterator iterates over collection?

583


What is the method overriding?

621


Who found java?

553


How do we access static members in java?

630