hai,
The output of the following code is 'A'.But if
we'll change m1's signature in all the classes to no argument method then output will be 'C'.why?
class A
{
void m1(A a)
{
System.out.print("A");
}
}
class B extends A
{
void m1(B b)
{
System.out.print("B");
}
}
class C extends B
{
void m1(C c)
{
System.out.print("C");
}
}
class D
{
public static void main(String[] args)
{
A c1 = new C();
C c3=new C();
c1.m1(c3);
}
}