15 lines
243 B
Java
15 lines
243 B
Java
public class Superclass {
|
|
|
|
public void printMethod() {
|
|
System.out.println("Printed in Superclass.");
|
|
}
|
|
}
|
|
|
|
public class Subclass extends Superclass {
|
|
|
|
public void printMethod() {
|
|
super.printMethod();
|
|
|
|
}
|
|
}
|