what is the difference between equals method and ==

Answer Posted / nagarjuna

equals method check the contents of the objects and returns
the boolean value.

== check the objects references

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we override compareto method?

510


Is call by reference possible in java?

540


What is void data type?

582


Can we create our own wrapper class in java?

548


How do you remove duplicates in java?

532






FOR EXAMPLE WE R HAVING TWO LIST ELEMENTS ..BOTH LISTS CONTAINS ID,NAME,PLACE ..I NEED TO COMPARE BOTH IDS IN TWO LISTS,IF ID'S R SAME MEANS WE HAVE ADD THE DETAILS(LIKE NAME,PLACE) TO MAP...HOW IS POSSIBLE ?CAN ANY ONE SUGGEST?

2643


What is java autoboxing?

541


What is hashtable and explain features of hashtable?

568


What is a protected class in java?

544


How do you differentiate abstract class from interface?

532


What are the classes of java?

543


Is vector ordered in java?

540


Does importing a package imports its sub-packages as well in java?

554


Is space a string in java?

515


What is the use of :: in java?

572