/* basic immutables */ public class mainer { public static void main(String[]args) { foo f = new foo(2,3); int p = f.bar(5); System.out.println("10:"+p); System.out.println("done."); } } immutable class foo { int x; int y; public foo() { x = 0; y = 0; } public inline foo(int x, int y) { this.x = x; this.y = y; } public inline int bar(int z) { return x + y + z; } }