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. "==" is used to compare primitive data types, while ".equals()" is used to compare objects.
D. None of the above.
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. "==" is used to compare primitive data types, while ".equals()" is used to compare objects. D. None of the above.