/** * Copyright (c): Uwe Schmidt, FH Wedel * * You may study, modify and distribute this source code * FOR NON-COMMERCIAL PURPOSES ONLY. * This copyright message has to remain unchanged. * * Note that this document is provided 'as is', * WITHOUT WARRANTY of any kind either expressed or implied. */ /** * ein Testprogramm fuer die Klasse ClassInfo * mit der die Laufzeit-Typinformation * angezeigt werden kann */ //-------------------- public class Main { public static void main(String[] argv) { try { ClassInfo ci = new ClassInfo("Y"); ClassInfo ii = new ClassInfo("If1"); System.out.println(ci.getClassInfo()); System.out.println(ii.getClassInfo()); } catch (Exception e) {} } } //-------------------- // ein paar Klassen und Schnittstellen // zum Testen von ClassInfo class X { protected int dx; } //-------------------- interface If0 {} //-------------------- interface If1 extends If0 { public static final String theQuestion = "???"; public void foo() throws Exception; } //-------------------- interface If2 {} //-------------------- abstract class Y extends X implements If1, If2 { public static final int theAnswer = 42; private int dy; public Y() {} private Y(String s) {} protected Y(int i, int j) {} public void foo() throws Exception { foo(); } } //--------------------