Hi donny,
U�r program is a classic example of not only method overriding but also method overloading & polymorphism. So u must have the concept of late binding & dynamic lookup clear b4 u can clearly understand the output. I will give u the output & the reason
Output:-
1. hello call prints :- hello from A
2. hello call prints :- hello from A why me
These two are for method overriding where the method with the most conformable signature is called,ie the 1st & 3rd hello of A
3. obj3 though of variable type A is actually a B object . So the hello of B is called . Since B has an appropriate hello method ,it prints hello from B
4. Similary obj4 being a C object which has the apt hello method it prints :- hello from C eat me C
5. obj5 is a C object. But C has no hello(). There4 it searches in the immediate superclass B 4 hello() & finds it. So it prints hello from B
The others can be explained similarly
Hope I am clear.
Regards,
Kaushik