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
Is a class an object?
What is a parameter in matrices?
Explain the pointers in Java?
What does mean in regex?
What do you mean by static variable?
What is final int?
Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)
What is empty list in java?
How many types of interfaces are there?
What two classes are used to read data only?
What is treeset in java?
What is variable length arguments in java?
How many bytes is string in java?
What is string pool in java?
How static variable work in java?