X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=tests%2FInstanceOf1.java;fp=tests%2FInstanceOf1.java;h=faf3dd98a589febbf85013f7961042499c32ca84;hb=717a866d25642626b22b9b3abbd8f98ce95c5e10;hp=0000000000000000000000000000000000000000;hpb=f0c1382a5ac2cf98fd6a9dcd3d193e47ca9ed8aa;p=mate.git diff --git a/tests/InstanceOf1.java b/tests/InstanceOf1.java new file mode 100644 index 0000000..faf3dd9 --- /dev/null +++ b/tests/InstanceOf1.java @@ -0,0 +1,17 @@ +package tests; + +public class InstanceOf1 { + public static void main(String []args) { + Instance1 x = new Instance1(); + if (x instanceof Instance1) { + System.out.printf("x is instance of Instance1 :-)\n"); + } else { + System.out.printf("x is *not* instance of Instance1 :-(\n"); + } + if (x instanceof Instance2) { + System.out.printf("x is instance of Instance2 :-)\n"); + } else { + System.out.printf("x is *not* instance of Instance2 :-(\n"); + } + } +}