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 are multiple inheritances?
What is default exception handling in java?
What is the difference between compare and compareto in java?
What is void data type?
How do you reverse a list?
What is a qualifier in a sentence?
Why is stringbuffer faster than string?
How does thread synchronization occurs inside a monitor? What levels of synchronization can you apply?
What is a layout manager and what are different types of layout managers available in java awt?
What is the purpose of the strictfp keyword?
Do I need java for windows 10?
What is * argv?
Why is sizeof not a function?
What checkbox method allows you to tell if a checkbox is checked?
Assume a thread has lock on it, calling sleep() method on that thread will release the lock?