Почему не проходит 5 условие?
package com.javarush.task.task15.task1529;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/*
Осваивание статического блока
*/
public class Solution {
public static void main(String[] args) {
}
static {
//add your code here - добавьте код тут
try {
result = reset();
} catch (Exception e) {
e.printStackTrace();
}
}
public static Flyable result;
public static Flyable reset() throws IOException{
//add your code here - добавьте код тут
Flyable flabl = null;
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
try {
String str = reader.readLine();
if("helicopter".equals(str)) {
flabl = new Helicopter();
} else if("plane".equals(str)) {
int num = Integer.parseInt(reader.readLine());
flabl = new Plane(num);
} else flabl = null;
} catch(IOException e) {
e.printStackTrace();
}
reader.close();
return flabl;
}
}