Can someone help me here?
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 c2 = new C(); c1.m1(c2);
}}
The output will be "A". I understand that method m1() is being overloaded here and not inherited, hence c1.m1(c2) will invoke class A's m1() method. Just wondering if I am thinking in right direction or missing something here?