/* more basic tests */ public class foo { public int flag = 0; public foo() {} public inline double twoargs(int x, double y) { System.out.println("WRONG METHOD!"); y *= 2; return x + y; } public inline int threeargs(int argone, char argtwo, float argthree) { if (argone > 0) { return argone; } else { return (int)(argtwo + argthree); } } public void docheck(bar b) { b.check(); } public static void main(String[] args) { int x = 13; float fl = 3.4f; bar b = new bar(); b.docheck(b); // check this ptr foo f = b; if (f.twoargs(1,3.4) != 3) System.out.println("wrong answer"); if (f.threeargs(x, 'h', fl) != 13) System.out.println("wrong answer"); System.out.println("done."); } } public class bar extends foo { public int flag = 1; public inline void check() { if (flag != 1) System.out.println("WRONG THIS PTR"); } public bar() {} public inline double twoargs(int x, double y) { y = x + 2; return y; } }