public class Base {
public Object print() {
return "Object from base method";
}
public static void main(String[] args) {
Base test = new Child();
System.out.println(test.print());
}
}
class Child extends Base {
public String print() {
return "String from child method";
}
}
Login in to like
Login in to comment