What will be the result of the following Java code? public class MyString {…

PYQ RPSC Programmer 2024

What will be the result of the following Java code? public class MyString { public static void main(String[] args) { String s1 = "Program"; String s2 = "Program"; System.out.println(s1 == s2); } }

  1. A.

    True

  2. B.

    Compilation error

  3. C.

    Runtime error

  4. D.

    False

  5. E.

    Question not attempted

Attempted by 411 students.

Sign up free to check your answer

Sign up free

Explore the full course: Rpsc Programmer

Loading lesson…