whats the difference between == and .equal ?
Answer Posted / deepak sharma
== compares the object refrences to see if they refer to the
same object in memory.
where as
.equals compares the content of object to see if the object
content is same. Most of the times it is used to compare the
String Object. It can be used to compare other Objects too.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Can a constructor have different name than a class name in java?
What is super keyword explain with example?
What is the scope or life time of instance variables?
Explain java coding standards for classes or java coding conventions for classes?
What is a map? What are the implementations of map?
Why lambda expression is used in java?
what are the disadvantages of indexes in oracle?
What is the purpose of methodology?
Can java hashmap have duplicate keys?
Can you give few examples of final classes defined in java api?
What is the default value of an object reference declared as an instance variable?
Differece between class and generic class?
Is a copy constructor?
What data type is string java?
What is parseint?