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.
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / guest
The answer to all this question is easy but i think they
want answer from internal mechanism how it works inside
Java!!!
You think you answered well but they will always fail you
just hate then
| Is This Answer Correct ? | 1 Yes | 10 No |
Nullpointer exception is a very common exception. Why is it not made as a checked exception?
What ide should I use for java?
What is vector capacity in java?
what is net based application and its types
write SQL command for table employee where print first name or last name start like "A" and who is working in domain(angular js,java,dotnet)
can we access the super class method using subclass object?
What does snprintf return?
If I only change the return type, does the method become overloaded?
Difference between current previous versions of Java?
What is an empirical question?
What is stop(), suspend(), resume() method?
did interface can implementation method ? i know its not possible but my interviewer said its possible ..but how..? any one have idea ???