Which one of the following will be the output of the below statements?

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

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

Which one of the following will be the output of the below statements?

String a[]={"Rohini", "Rajarshi", "Rajeev", "Rehan", "Rebecca"}; 
System.out.println(a[2].substring(2));
Show SolutionHide Solution↓

jeev

Reason — In the array, the element at position 2 is "Rajeev". In Java, string indexing starts from 0, so index 0 = R, index 1 = a, and index 2 = j. Using substring(2) means we take all characters from index 2 to the end, giving "jeev".

← Previous questionNext question →

Browse the free Computer Applications sample bank