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
Is java an ide?
What methods are used in Servlet?Applet communication?
Difference between object instantiation and construction ?
Is ++ operator thread-safe in java?
Is math an abstract class in java?
Why does java does not support multiple inheritance? Explain
Explain 5 features introduced in jdk 1.7?
How can you set an applet’s height and width as a percentage?
What does string intern() method do?
What is the use of runnable interface?
What is communist flag?
What are the different ways of implementing thread? Which one is more advantageous?
Explain the difference between collection api and stream api in java8?
How to provide security in java
Explain the features of interfaces in java?