Values & References4 / 16
Up next

Immutable strings

class Main {
    public static void main(String[] args) {
        String s = "hello";
        // this result is discarded; s does not change
        s.toUpperCase();
        System.out.println(s);
        // you must assign the new string
        String up = s.toUpperCase();
        System.out.println(up);
    }
}
What you're solving

capture the returned value