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
How does the garbage collector works in java?
How will you reverse a singly-link list?
What is the purpose of encapsulation?
What is the same as procedures?
What is the use of arraylist class in java?
Can a class be final?
What is difference between java and java ee?
How do you sort arrays in java?
What are exception handling keywords in java?
Explain java heap space and garbage collection?
what is mutual exclusion? : Java thread
Write a program to find the greatest of three numbers in java?
What is the final keyword?
How to restrict a member of a class from inheriting by its sub classes?
Why for each loop is used?