Une collection de snippets Java modernes. Chaque ancien pattern Java à côté de son remplacement moderne et propre — côte à côte.
public class Point {
private final int x, y;
public Point(int x, int y) { ... }
public int getX() { return x; }
public int getY() { return y; }
// equals, hashCode, toString
}
public record Point(int x, int y) {}