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

PROGRAMMING:Construction method

Luz5年前 (2021-05-10)题库428
Please add the following code to complete the output requirements.
```java
public class Main {
public Main(){
System. Out. Println ("construction method 1 is called");
}
public Main(int x){
this();
System. Out. Println ("construction method 2 is called");
}
public Main(boolean b){
this(1);
System. Out. Println ("construction method 3 is called");
}
public static void main(String[] args) {
}
}
```
###Input format:
nothing
###Output format:
Output the following three lines:
The constructor is called
Constructor 2 is called
Constructor 3 is called
###Input example:
```in
nothing
```
###Output example:
```out
The constructor is called
Constructor 2 is called
Constructor 3 is called
```






answer:If there is no answer, please comment