What is the output of the Java code? String s = "Java";
What is the output of the Java code?
String s = "Java";
System.out.println(s.charAt(2) + s.length());
Show answerHide answer
Correct answer: (A) 122
Explanation
charAt(2) = 'v' (118); char + int is int: 118 + 4 = 122.