The output of the below statement is:

ICSE Class 10 Computer Applications PYQ · 2025 Paper · Section A

1(xviii)1 Mark · 2025 · Section A · 2025 Paper

The output of the below statement is:

System.out.println("I said, \"It\'s wise to obey elders.\"");

Show SolutionHide Solution↓

I said, "It's wise to obey elders."

Reason — In Java, the backslash \ is used as an escape character. The statement uses escape sequences:

  • \" to include double quotes inside a string.
  • \' to include a single quote inside a string.

So the output preserves both the double quotes around "It's wise to obey elders." and the apostrophe in It's.

Hence, the output is: I said, "It's wise to obey elders."

← Previous questionNext question →

Browse the free Computer Applications sample bank