Programming MCQS - QUESTION DETAILS

Which method is called to compare objects for equality in Java?
A. compare()
B. equals()
C. compareTo()
D. equality()

'equals()' is used to compare objects for equality in Java.

Similar Questions

How do you define a multi-line macro in C?






How do you declare a constant integer in C?






What is the purpose of the 'default' keyword in a switch statement?






What is the purpose of the 'strcmp' function in C?






What is the output of printf("%d", 5 << 2);?






What is the purpose of the 'strtok' function in C?






What is the output of printf("%d", sizeof(1.5));?






What is the output of System.out.println("Java" == "Java");?






What is the role of the 'auto' keyword in C?






What is the role of the 'static' keyword in Java?