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
Can static methods access instance variables in java?
Why collection is called framework in java?
What is java abstraction with example?
What are the main features of java?
What is public static?
What is double word?
what are the methods in object?
Can you access non static variable in static context?
Explain the Propertie sof class?
How do you define a singleton class?
What are different types of inner classes ?
What is meant by nested loop?
How do you check whether the list is empty or not in java?
If you are given the name of the function at run time how will you invoke the function?
What do you mean by constant time complexity?