Computer Applications
What do the following functions return?
String x = "Vision";
String y = "2020";
System.out.println(x.length());
Java
Java String Handling
30 Likes
Answer
6
Working
x.length()
will give the number of characters in string x
which is 6.
Answered By
15 Likes
Related Questions
What do the following functions return?
String x = "Vision"; String y = "2020"; System.out.println(x.charAt(3));
Predict the output of the following Java program snippet:
String str1 = "Information Technology"; String str2 = "information technology"; boolean p = str1.equalsIgnoreCase(str2); System.out.println("The result is " + p);
What do the following functions return?
String x = "Vision"; String y = "2020"; System.out.println(x.equals(y));
What do the following functions return?
String x = "Vision"; String y = "2020"; System.out.println(x + y);