Danny G (3) [Avatar] Offline
#1
Currently code sample is:

public final class ImmutableHello {
  public ImmutableHello(String name) {
    this.name = name;
  }
  public String getName() {
    return name;
  }
}


Looks like this is missing a
private final String name;
declaration.

You may also want to mention java libraries such as Immutables and AutoValue as yet another alternative to creating immutable classes (as also recommended by Lightbend). I wouldn't think you'd have to go into any details, but IMHO these help remove Java boilerplate immensely and provide correct immutable implementations.