Computer Applications
If:
String x = "Computer";
String y = "Applications";
What do the following function returns?
System.out.println(y + x.substring(5));
Java
Java String Handling
33 Likes
Answer
Applicationster
Working
x.substring(5)
will return the substring of x
starting at index 5 till the end of the string. It is "ter". This is added to the end of string y
and printed to the console as output.
Answered By
18 Likes
Related Questions
If:
String x = "Computer";
String y = "Applications";
What do the following function returns?
System.out.println(x.substring(1,5));Give the output of the following:
String n = "Computer Knowledge"; String m = "Computer Applications"; System.out.println(n.substring(0,8).concat(m.substring(9))); System.out.println(n.endsWith("e"));
If:
String x = "Computer";
String y = "Applications";
What do the following function returns?
System.out.println(x.indexOf(x.charAt(4)));If:
String x = "Computer";
String y = "Applications";
What do the following function returns?
System.out.println(x.equals(y));