X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=tests%2FInstance4.java;h=8707502c18ce8210e14da5e268850295b2426cc2;hb=HEAD;hp=0ecd257fa5437201d993c55324364e5ebf3ffc8c;hpb=54a2170d22bb853afa42d87eeeffd8b633efcd36;p=mate.git diff --git a/tests/Instance4.java b/tests/Instance4.java index 0ecd257..8707502 100644 --- a/tests/Instance4.java +++ b/tests/Instance4.java @@ -1,19 +1,20 @@ package tests; -public class Instance4 extends Instance2 { +public class Instance4 { + public int a, b; + public Instance4() { - x = 0x11; - y = 0x22; + this(0x666, 0x1337); } - public static void main(String []args) { - Instance2 a = new Instance4(); - a.getX(); // 0x1337 - Instance4 b = (Instance4) a; - b.getX(); // 0x1337; + public Instance4(int x, int y) { + this.a = x; + this.b = y; } - public int getX() { - return 0x1337; + public static void main(String []args) { + Instance4 x = new Instance4(); + System.out.printf("result: 0x%08x\n", x.a); + System.out.printf("result: 0x%08x\n", x.b); } }