Consider the following Java classes:
Do these classes compile? Explain your answer. If not, what should you change to make them compile?
In the above classes (fixed to compile, if necessary), what will be the effect of replacing the empty body of foo()
in B
with the single
statement: super.foo()
? Will this cause compilation problems? If so, how should you fix them?