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
Is arraylist an object in java?
Differentiate between the constructors and methods in java?
What is the difference between jvm and jre? What is an interface?
How are observer and observable used in java programming?
Can a class extend 2 classes in java?
Can you override a final method?
What is the use of private static?
Explain about the security aspect of java?
How do you remove duplicates in java?
What is the difference between superclass and subclass?
Why doesn't the java library use a randomized version of quicksort?
What is a 16 bit word?
What is this keyword in java?
Does the order of public and static declaration matter in main method?
How hashmap works in java?