Which changes do I need to make to the code below in order for a.f2(); to work?
I've been asked to change the way I added void f2(){} to class A.
No additional free space was included in this code.
I went through some resources but didn't get it.
Code:
public class A { void f1(){} } public class B extends A { void f2(){} } void main(String[] args) { A a = ... <- free space here a.f1(); }
No additional free space was included in this code.
I went through some resources but didn't get it.
Comment