CJCoding With Joseph
15free / daySign inCreate account
Back to Code Walkthrough

String Length and charAt

Java code walkthrough · Question 17
easyPrinting

Code

Read carefully. What does this print?
1public class Main {
2 public static void main(String[] args) {
3 String word = "Hello";
4 System.out.println(word.length());
5 System.out.println(word.charAt(1));
6 System.out.println(word.charAt(4));
7 }
8}

Your answer