/* immutable constructors */ public class mainer { public static void main(String [] args) { doit(); System.out.println("done."); } public static inline void doit() { MyImmut immut = new MyImmut(12); MyImmut immut2 = new MyImmut(); System.out.println("12:" + immut.A); System.out.println("5:" + immut2.A); } } immutable class MyImmut { int A; public inline MyImmut() { this(5); } public inline MyImmut(int A) { this.A = A; } }