A class C has a void method m with no parameters. Another class D extends C and overrides m. Each class has a constructor with no parameters. In each of the following, say whether it is legal, and if so, which definition of m will be used.
i) C x = new D();
x.m();
ii) D x = new C();
x.m();
I think i is legal, and ii is not illegal. Not sure how I get my head around this question, any hints are welcome.