Компилятор выдает ошибку компиляции
В чем может быть дело?
package com.javarush.task.task15.task1522;
import java.util.*;
import java.io.*;
/*
Закрепляем паттерн Singleton
*/
public class Solution {
public static Planet thePlanet;
static {
try {
readKeyFromConsoleAndInitPlanet();
}catch(IOException e) {
e.printStackTrace();
}
}
public static void main(String[] args) {
}
//add static block here - добавьте статический блок тут
public static void readKeyFromConsoleAndInitPlanet() {
// implement step #5 here - реализуйте задание №5 тут
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String str = reader.readLine();
if(str == Planet.SUN) {
Planet thePlanet = Sun.getInstance();
}else if(str == Planet.MOON) {
Planet thePlanet = Moon.getInstance();
}else if(str == Planet.EARTH) {
Planet thePlanet = Earth.getInstance();
}else{
thePlanet = null;
}
}
}