This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
it means you are creating Polymorphic reference. that is super class reference variable(class A) is refers to sub class object(Class C).
Since we extend super classes A and B in C,we have three overloaded methods in class C. so when we invoke using c2 reference variable , it will look for methods that are available in both the classes (A and C). In this case only one method is matched (super class A's method , which can accept all the sub types).
So that it prints AAA.
Make some changes At line 28 ==> C c2 = new C();
then it will print ABC