whats the difference between == and .equal ?
Answer Posted / jai
== this is equal to it mainly compares only the values of
the object if both are equal it returns true or else false
eg. a=10,b=20
if (a==b)
it will return false
for the same case it will return false for .equals since
.equals will check only that the objects refr to the same
reference (address) of the instance
clear
| Is This Answer Correct ? | 1 Yes | 10 No |
Post New Answer View All Answers
What is reflexive association?
What are advantages and disadvantages of OOPs?
extending thread class or implementing runnable interface. Which is better? : Java thread
Is arraylist ordered in java?
Can we declare the static variables and methods in an abstract class?
Is arraylist dynamic in java?
Can a class have a static inner class?
How to make a non daemon thread as daemon?
What is final keyword in java?
What is the declaration statement?
What is the difference between abstract classes and interfaces?
A non-static inner class may have object instances that are associated with instances of the class’s outer class. A static inner class does not have any object instances.
What is externalizable?
Why does java does not support multiple inheritance? Explain
What is considered an anti pattern?