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
Can we override singleton class?
What is the definition of tree ?
What is passing parameters in java?
What are advantages and disadvantages of OOPs?
What type of language is java?
What are the ways in which a thread can enter the waiting state?
Realized?
What is hashtable and explain features of hashtable?
How do you add spaces in java?
What is string subsequence method?
What is the difference between jdk, jre, and jvm?
What is the difference between procedural and object-oriented programs?
Which class is the superclass of all classes?
Can a class have multiple constructors?
Will minecraft java be discontinued?