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



Accenture NJ mostly ask question on Collection like 1)How to sort Objcts and how treeset sort them ..

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

Accenture NJ mostly ask question on Collection like 1)How to sort Objcts and how treeset sort them ..

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

Post New Answer

More Core Java Interview Questions

How does hashmap work in java ?

0 Answers  


What is a method declaration?

0 Answers  


What is meant by method overriding?

0 Answers  


What is the difference between Stream Reader and Stream Writer?

4 Answers  


int a=1; float b=1.0; System.out.println(a==b);

13 Answers   CTS, Honeywell, McAfee,






how can i connect to database in a applet ?

1 Answers  


Is stringwriter thread safe?

0 Answers  


How much is a java license?

0 Answers  


Do you know thread pools?

0 Answers   BMC,


is this possible to create an array of 0 length? if so how? if not so why? coz we have an array in main() likw this "static void main(String [] s) then what it signifies?

3 Answers   Hexaware, TCS,


Why can't we use static class instead of singleton?

0 Answers  


What is method reference in java?

0 Answers  


Categories