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
What is the meaning of 3 dots in java?
how a programmer confirms that the data submitted has been succesfully inserted into the database(either oracle or my sql).. How a programmer confirm if there is any problem with the program he wrote for insertion... ANS:--- >executeupdate method is having boolean return type, if anything goes wrong in data insertion or data updation, it would return false. otherwise, if it successfully inserts data into the database, it would return true NOW HOW TO I CHECK IN MY DURING EXECUTION WHETHER IT RETURNS TRUE OR FALSE... WELL IT WILL DISPLAY ANY MESSAGE OR NOT
Write a code to create a trigger to call a stored procedure
What is locale?
In a program, initializing an array of 100 KB is throwing an out of memory exception while there is 100 MB of memory available. Why?
What is the function of character?
Can a abstract class be declared final?
What is an example of character?
What is singleton class example?
What are static initalizers in java ?
What is the difference between object oriented programming language and object based programming language?
Can a final variable be null?
How do we access static members in java?
When a byte datatype is used?
How big is a boolean?