Here I created an Object for C class, due to inheritance mechanism it may create totally Three objects(C,B and A ). I calculated by viewing code. But I want to calculate by programmatic-ally. I mean, Is it possible to calculate how may Objects created by My Class and What they are?
Below is my code:

class A {A() { System.out.println("class A");}}class B extends A {B() { System.out.println("class B");}}class C extends B {public static void main(String args[]) { C c = new C();}}

Check Solution