← Back to Question List
Java Code Walkthrough #17
String Length and charAt
📄 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}