-->
当前位置:首页 > 题库

PROGRAMMING:Program fill in question 3

Luz5年前 (2021-05-10)题库626
Refer to the output sample to complete the following program, so that the program output is consistent with the output sample.

public class Main {
public static void main(String[] args) {
Son son = new Son();
son.method();
}
}
class Parent {
Parent() {
System.out.println("Parent's Constructor without parameter");
}
Parent(boolean b) {
System.out.println("Parent's Constructor with a boolean parameter");
}
public void method() {
System.out.println("Parent's method()");
}
}
class Son extends Parent {
//Complete the definition of this class
}

###Input format:
nothing
###Output format:
nothing
###Input example:
```in
```
###Output example:
```out
Parent's Constructor with a boolean parameter
Son's Constructor without parameter
Son's method()
Parent's method()
```







answer:If there is no answer, please comment