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 are the main differences between notify and notifyAll in Java?
What do you mean by object?
What is empty list in java?
What is navigable map in java?
What are void pointers?
Why do we use regex?
what is predefined function in java?
What ide should I use for java?
What are wrapper classes in java?
What are exceptions
take an array with -ve and +ve value both.find out the nearest value of 0(zero).if two values are same like(-2 and +2)then extract +2 is nearest of 0(zero).
Explain notifyall() method of object class ?
What is the difference between a window and a frame in java programming?
What is string immutability?
What does indexof mean?