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 a flag value?
Why string is not thread safe?
Why is multiple inheritance not supported in java?
What are the common uses of "this" keyword in java ?
What about abstract classes in java?
What is a void in java?
What are passing parameters?
What is use of super keyword in java?
How is tree Mirroring implemented?
What is local class in java?
Why wait(),notify(),notifyAll() methods defined in Object class althought we are using in only threads.
In which order the iterator iterates over collection?
What is the method overriding?
Who found java?
How do we access static members in java?