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
Which number is denoted by leading 0x or 0x in java?
which one is more efficient int x; 1. if(x==null) 2.if(null==x) state which one either 1 or 2?
How would overload a function based on return type?
What is difference between module and function?
What is the functionability stubs and skeletons?
What is java object name?
What is data structure in java?
What is difference between static class and singleton pattern?
When arithmeticexception is thrown?
What are the advantages of inner classes?
What is the difference between call by reference and call by pointer?
Differentiate between array list and vector in java.
What is json parser in java?
What are the advantages of functions?
What is the difference between keyword and identifier?