What is the difference between the "equals" method and the "==" operator in Java?
A. The "equals" method compares the values of two objects, while the "==" operator compares the memory addresses of two objects.
B. The "equals" method compares the memory addresses of two objects, while the "==" operator compares the values of two objects.
C. The "equals" method is used for comparing primitive data types, while the "==" operator is used for comparing objects.
D. None of the above.
Answer:A
What is the difference between the "equals" method and the "==" operator in Java?
A. The "equals" method compares the values of two objects, while the "==" operator compares the memory addresses of two objects. B. The "equals" method compares the memory addresses of two objects, while the "==" operator compares the values of two objects. C. The "equals" method is used for comparing primitive data types, while the "==" operator is used for comparing objects. D. None of the above.