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

class test { private static void main(String []adsf) { } } explain me that the above code is error or exception

3 Answers  


How do you remove an element from an arraylist in java?

0 Answers  


What is the difference between static (class) method and instance method?

0 Answers  


where u use Abstraction and Interface in real time

3 Answers   Sonata,


What is difference between Iterator and for loop

9 Answers   HP,






is memory to the abstract class allocated ..or objects not instantiated

7 Answers   Synechron, TCS,


How can you reverse a string?

8 Answers  


What is the differences between heap and stack memory in java? Explain

0 Answers  


What is number data type?

0 Answers  


What do you understand by copy constructor in java?

0 Answers  


In Java why we write public static void main(String args[]) why not main()?

46 Answers   Aptech, GE Healthcare, Infosys, Microsoft, New Horizon, Practical Viva Questions, TCS, Wipro,


What is t type java?

0 Answers  


Categories