I think my answer is right
package zh.codegym.task.task15.task1529;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/*
掌握 static 块
*/
public class Solution {
public static void main(String[] args) {
}
static {
//在此编写你的代码
try {
reset();
}catch(IOException exc) {}
}
public static CanFly result;
public static void reset() throws IOException{
//在此编写你的代码
try {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String type = reader.readLine();
switch(type) {
case "helicopter":
result = new Helicopter();
case "plane":
result = new Plane(Integer.parseInt(reader.readLine()));
}
reader.close();
}catch(IOException exc) {}
}
}