Computer Applications
What do the following functions return?
String x = "Vision";
String y = "2020";
System.out.println(x.charAt(3));
Java
Java String Handling
35 Likes
Answer
i
Working
x.charAt(3)
will return the character at index 3 of string x
which is i.
Answered By
19 Likes
Related Questions
What do the following functions return?
String x = "Vision"; String y = "2020"; System.out.println(x.equals(y));
Predict the output of the following Java program snippet:
String S1 = "Computer World"; String S2 = "COMPUTER WORLD"; String S3 = "Computer world"; String S4 = "computer world"; System.out.println(S1 + " equals "+ S2 + " " + S1.equals(S2)); System.out.println(S1 + " equals "+ S3 + " " + S1.equals(S3)); System.out.println(S1 + " equals "+ S4 + " " + S1.equals(S4)); System.out.println(S1 + " equalsIgnoreCase "+ S4 + " " + S1.equalsIgnoreCase(S4));
What do the following functions return?
String x = "Vision"; String y = "2020"; System.out.println(x + y);
What do the following functions return?
String x = "Vision"; String y = "2020"; System.out.println(x.length());