MCQs > IT & Programming > Java > What is displayed when the following code is compiled and executed? String s1 = new String('Test'); String s2 = new String('Test'); if (s1==s2) System.out.println('Same'); if (s1.equals(s2)) System.out.println('Equals');

Java MCQs

What is displayed when the following code is compiled and executed? String s1 = new String("Test"); String s2 = new String("Test"); if (s1==s2) System.out.println("Same"); if (s1.equals(s2)) System.out.println("Equals");

Answer

Correct Answer: Equals

Explanation:

Note: This Question is unanswered, help us to find answer for this one

Java Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

Java Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it