package study.hard.javalib.nativelib;

public class GetClassTest {

	public static void main(String[] args) {
		GetClassTest tester = new GetClassTest();
		ExtendedClassA extendedA = tester.new ExtendedClassA();
		extendedA.printClass(); // class study.hard.javalib.nativelib.GetClassTest$ExtendedClassA

		Class<? extends ClassA> clazz = extendedA.getClass();
		System.out.println(clazz.getName());
	}

	public class ClassA {
		public void printThisClass() {
			System.out.println(getClass());
		}
	}

	public class ExtendedClassA extends ClassA {
		public void printClass() {
			printThisClass();
		}
	}

}

@@ -329,16 +329,17 @@
 A%3E clazz
+1
  = exten
@@ -381,16 +381,17 @@
 ln(clazz
+1
 .getName
@@ -394,16 +394,155 @@
 Name());
+%0A%0A%09%09Class%3C? extends ClassA%3E clazz2 = ExtendedClassA.class;%0A%09%09System.out.println(clazz2.getName());%0A%0A%09%09System.out.println(clazz1 == clazz2);
 %0A%09%7D%0A%0A%09pu

Add a test case to check identity of result of getClass() and classname.class.