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
I want to store more than 10 objects in a remote server? Which methodology will follow?
What are the two parts of a conditional statement?
How can an object be unreferenced?
1.IN CASE OF DYNAMIC METHOD DISPATCH WHY WE USE REFERENCE VARIABLE,WE CAN USE THE DIFFERENT DEFINED OBJECT DIRECTLY TO ACCESS THE DATA MEMBER AND MEMBER FUNCTION OF THAT RESPECTIVE CLASS?WHAT IS THE MAIN FUNCTION OF "REFERENCE VARIABLE" HERE?
How do you compare two strings lexicographically?
What is downcasting?
How does list work in java?
What are the different approaches to implement a function to generate a random number?
What is string value?
Which is faster call by value or call by reference?
Explain Basics of OOP Language in java
In which language java is written?
Explain about sets?
What is the purpose of the file class in java programming?
Why volatile is used in java?