Inheritance1 x1 is-a X x1 is-a Object x1 is-NOT-a Y y1 is-a Y y1 is-a X y1 is-a Object ************************ Inheritance2 x1.i= 3 y1.i= 3 y1.j= 4 hello from X m1() hello from X m1() hello from Y m2() ************************ Inheritance3 hello from X m1() hello from X m1() ********** hello from Z m1() hello from W m1() hello from Z m1() hello from X m1() hello from X m1() hello from X m1() hello from X m1() hello from X m1() hello from X m1() hello from Z m1() ************************ Inheritance4 x1.getI_priv()= 3 x1.i_prot= 3 y1.i_prot= 3 hello from Y m2() x1.i_prot= 3 y1.i_prot= 12 ************************ Inheritance5 creating an X: hello from X() constructor creating an X(4): hello from X(int) constructor creating an Y(): hello from X() constructor hello from Y() constructor creating an Y(3.0): hello from X() constructor hello from Y(double) constructor creating an Y(3): hello from X(int) constructor hello from Y(int) constructor ************************ Polymorphism x1.m1Inherited(): hello from X m1() x1.m3Overridden(): hello from X m3() y1.m1Inherited(): hello from X m1() y1.m3Overridden(): hello from Y m3() y1.m2Subclass(): hello from Y m2() x2.mInherited(): hello from X m1() x2.m3Overridden(): hello from Y m3() ((Y)x2).m2Subclass(): hello from Y m2() ((Y)x2).m2Subclass(): hello from Y m2() ((Y)x1).m2Subclass(): hello from Y m2()