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

Which number is denoted by leading 0x or 0x in java?

834


which one is more efficient int x; 1. if(x==null) 2.if(null==x) state which one either 1 or 2?

10184


How would overload a function based on return type?

774


What is difference between module and function?

778


What is the functionability stubs and skeletons?

917


What is java object name?

761


What is data structure in java?

747


What is difference between static class and singleton pattern?

698


When arithmeticexception is thrown?

812


What are the advantages of inner classes?

757


What is the difference between call by reference and call by pointer?

735


Differentiate between array list and vector in java.

889


What is json parser in java?

825


What are the advantages of functions?

720


What is the difference between keyword and identifier?

800