Hi,
I am agree with veneet Sharma. Yes C3 has three methods void hello(), void hello( String s) and void hello( int i );. Actually this is also related with
polymorphism. In the same class, methods are being overloaded. But how you can find your
different method when it has same name. Acutally based on method's arguments. Look,
Class A3 has two method but different arguments:
void hello() - there is no arg.
void hello(int i) - there is an int arg.
So you can find your method based on argument and you can override your method if it has same type arguments. So
Class B3 extends A3 and can override A3 class's method easily
as it has same type arg. method. When C3 extends B3 and if
C3 has same method as B3, automatically it will override B3's
method ie. A3 as same type of method arg.
But when C3 extends B3{}, it has ccome different method, i.e.
void hello( String s) , which couldn't override B3's method as
B3 has different method. So C3 adds extra one method instead of
overriding.
This example is very important to know about polymorphism,
overloading method but different arguments and inhertance
class and also overriding method.
Thanks,
G. Newaz