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 the difference between pass by reference and pass by pointer?
What are the characteristics of java?
What is local class in java?
What is core java called?
When is finally block not called?
What type of value does sizeof return?
What is the purpose of java?
What is string in java with example?
What is output buffer?
Why string is not thread safe?
What is a predicate method?
Does the order of public and static declaration matter in main method?
What are the different types of java?
Can we override the overloaded method?
What is the purpose of main function in java?