Strings In Depth2 / 18
Up next

Index a string

class Main {
    public static void main(String[] args) {
        String s = "python";
        // there is no s[0]; use charAt
        System.out.println(s.charAt(0) + " " + s.charAt(s.length() - 1));
        System.out.println(s.length());
    }
}
What you're solving

charAt and length