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

Does sprintf add a null terminator?

815


What is collection class in java?

719


What do you understand by the bean persistent property?

753


What is the difference between yielding and sleeping?

779


What is java used for?

765


What is the synonym of procedure?

728


Does windows 10 need java?

788


What are daemon Threads in java?

854


I want to print “hello” even before main is executed. How will you acheive that?

880


Is singleton class immutable?

716


What is exception in java?

745


What is set and get methods in java?

730


What are the application of stack?

676


What is the use of bufferedreader?

744


What are the four corner stones of oop?

767