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


Please Help Members By Posting Answers For Below Questions

What is return keyword in java?

808


What is the difference between hashmap and hashtable? What is an interface?

782


What is the use of math abs in java?

740


Can we have multiple classes in a single file?

723


In Java list the methods that can be overridden?

780


Explain about procedural programming language or structured programming language and its features?

780


what do you mean by java annotations?

778


How do you get length in java?

783


How do you include a string in java?

750


Explain about the main() method in java?

802


What is meant by attribute?

776


What is the type of lambda expression?

729


What is flush () in java?

770


What restrictions are placed on method overloading in java programming?

770


What do you mean by inner class in java? Explain

806