Answer Posted / javamasque
“==”: 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 |
Post New Answer View All Answers
What is derived datatype?
Which package is always imported by default?
Explain access modifiers in java.
Explain throw keyword in java?
Explain about transient variables in java?
What is function and method in java?
How do I remove a character from a string in java?
Is an integer an object?
Does constructor return any value?
Is list thread safe in java?
Explain the difference between abstract class and interface in java?
What is number data type in java?
What are facelets templates?
I want my class to be developed in such a way that no other class (even derived class) can create its objects. Define how can I do so?
Which are different kinds of source code?