where is .equals() method and how is it different from ==
operation <giving some confusing implementation> Is hashing
related to these?

Answer Posted / tanuj

== operator return true if both reference variable pointing
to same object.
equals() method also use == as default, but String and
Wrapper classes override (you can also override) it but
meaningfull comparison , as in two same String case it
returns true for equals()method.

for knowing it clearly make small programs by using both.
there are so many exception in wrapper classes.

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the size of integer?

581


What are different types of states exist for a thread?

543


What is a bufferedreader?

522


What package is math in java?

530


what is optional in java 8?

549






What is the purpose of javac exe?

555


Write a program to find the greatest of three numbers in java?

557


What is rmi and steps involved in developing an rmi object?

565


What is static and final keyword in java?

573


Can you inherit a constructor java?

571


What is equals method in java?

522


What is static variable with example?

557


Difference between Linked list and Queue?

604


What are 5 boolean operators?

614


What is meant by distributed application? Why are we using that in our application?

545