What is difference between “==” and equals()?
“==”: It compares references (memory locations). It does not compares values in the memory location. Hence it is not recommended to find the equality of two objects. It is mostly used to compare primitive types.
equals(): It is used to find the equality of two objects. It actually compares with the values that an object contains.
| Is This Answer Correct ? | 5 Yes | 0 No |
What are the advantages of java?
What is an empty class? What functionality does it offer in Java?
0 Answers Deloitte, EXL, JPMorgan Chase,
what is Thread?
What is included in core java?
What is deserialization and how do we do deserialization?
what are different ways in which a thread can enter the waiting state? : Java thread
What does arrays sort do in java?
we cannot create an object of interface but we can create a variable of it
Explain the importance of throws keyword in java?
What do you mean by ternary operator in java?
What are computer functions?
Which sorting algorithm is best in java?