class ClassPath { void printClassName(Object obj) { System.out.println("The class of " + obj + " is " + obj.getClass().getName()); } public static void main(String ... args) { String StrV = System.getProperty("java.version"); System.out.println("Java Version: " + StrV); System.out.println("Zeige den Klassen Pfad"); String Str = System.getProperty("java.class.path"); int pos = 1 + Str.indexOf(';'); while (pos > 0){ System.out.println(Str.substring(0,pos)); Str = Str.substring(pos); pos = 1 + Str.indexOf(';'); } System.out.println(Str); System.out.println("Print Class Name:"); ClassPath o = new ClassPath(); o.printClassName(o); } }