What is the difference between “==” and “equals” in Java?
A. “==” compares the memory addresses of two objects, while “equals” compares the values of the objects.
B. “==” compares the values of two objects, while “equals” compares the memory addresses of the objects.
C. “==” compares the type of two objects, while “equals” compares the value of the objects.
D. “==” compares the value of primitive data types, while “equals” compares the reference of objects.
Answer:A
What is the difference between “==” and “equals” in Java?
A. “==” compares the memory addresses of two objects, while “equals” compares the values of the objects. B. “==” compares the values of two objects, while “equals” compares the memory addresses of the objects. C. “==” compares the type of two objects, while “equals” compares the value of the objects. D. “==” compares the value of primitive data types, while “equals” compares the reference of objects.