From 08d5f7b0a0b24c042aa5976f66bf3a1b5b754478 Mon Sep 17 00:00:00 2001 From: Richard Zahoransky Date: Mon, 7 Nov 2011 16:29:56 +0100 Subject: Localization Code. How-To will follow... --- voronoi/Classtest.java | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 voronoi/Classtest.java (limited to 'voronoi/Classtest.java') diff --git a/voronoi/Classtest.java b/voronoi/Classtest.java new file mode 100644 index 0000000..9f13fde --- /dev/null +++ b/voronoi/Classtest.java @@ -0,0 +1,36 @@ +package voronoi; +class Parent { + public Parent() { + + } +} + +class Child extends Parent { + public Child() { + super(); + } +} + +public class Classtest { + public static void main(String[] a) { + Parent[] test = new Parent[3]; + test[0] = new Parent(); + test[1] = new Parent(); + test[2] = new Child(); + + int count = 0; + for (Parent parent : test) { + System.out.print("Index " + count + " is of type: "); + if (parent instanceof Child) { + System.out.println("Children"); + } + if (parent instanceof Parent) { + System.out.println("Parent"); + } + + count++; + + } + + } +} -- cgit v1.2.3-55-g7522