Output Questions for Class 10 ICSE Computer Applications

If:
String x = "Computer";
String y = "Applications";

What do the following function returns?

System.out.println(x.substring(1,5));

Java

Java String Handling

50 Likes

Answer

ompu

Working

x.substring(1,5) will return a substring of x starting at index 1 till index 4 (i.e. 5 - 1 = 4).

Answered By

24 Likes