What will be the output of the following statement?

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

1(viii)1 Mark · 2025 · Section A · 2025 Improvement

What will be the output of the following statement?

String s = "JavaProgramming";
System.out.println(s.substring(4, 11).toUpperCase());
Show SolutionHide Solution↓

PROGRAM

Reason — In the string "JavaProgramming", indexing starts at 0. substring(4, 11) extracts characters from index 4 to 10, which is "Program". Calling .toUpperCase() converts it to "PROGRAM".

← Previous questionNext question →

Browse the free Computer Applications sample bank