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 keyword in java?
What is the difference between hashmap and hashtable? What is an interface?
What is the use of math abs in java?
Can we have multiple classes in a single file?
In Java list the methods that can be overridden?
Explain about procedural programming language or structured programming language and its features?
what do you mean by java annotations?
How do you get length in java?
How do you include a string in java?
Explain about the main() method in java?
What is meant by attribute?
What is the type of lambda expression?
What is flush () in java?
What restrictions are placed on method overloading in java programming?
What do you mean by inner class in java? Explain