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 stringwriter?
Difference between class#getinstance() and new operator ?
What is wrapper class html?
What happens if we override private method?
Can you have two constructors in java?
What is the purpose of a parameter?
What are default methods ?
How will you serialize a singleton class without violating singleton pattern?
How to make object serializable in java?
What are register variables what are the advantages?
What are the differences between processes and threads?
What is a bubble sort in java?
What are pass by reference and pass by value?
What are the restrictions that are applied to the java static methods?
What if the main() method is declared as private? What happens when the static modifier is removed from the signature of the main() method?