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