What will be the output of the following code? public class Demo { public…

PYQ RPSC Programmer 2024

What will be the output of the following code? public class Demo { public static void main(String[] args) { String str = "Hello"; str = str + "World"; str = str.substring(5,10); System.out.println(str); } }

  1. A.

    Hello

  2. B.

    Hello World

  3. C.

    ello

  4. D.

    World

  5. E.

    Question not attempted

Attempted by 277 students.

Sign up free to check your answer

Sign up free

Explore the full course: Rpsc Programmer

Loading lesson…