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 return code?
What is generic class?
What are features of java?
Explain serialization and deserialization in java?
What is the purpose of file class?
Which sorting algorithm is in place?
Can we overload destructor in java?
What is t in parametric equations?
Explain about data types?
Can static methods access instance variables in java?
What are the two ways in which thread can be created?
What is the difference between delete and delete[]
What is mean by exception?
Explain runtime exceptions?
What is the format specifier?