Question

Consider the following Java code: public class SubstringDryRun {     public static void main(String[] args) {         String s = "Programming";         String s1 = s.substring(3, 7);         String s2 = s.substring(s.indexOf('g') + 1);         System.out.println(s1 + s2);     } } What will be the output of this program?

A gramramming
B gramming
C programming
D ming
E ramming
Practice Next

Hey! Ask a query