Почему вечно не проходит этот проклятый moon я уже не пойму?
package com.javarush.task.task15.task1522;
import java.io.*;
/*
Закрепляем паттерн Singleton
*/
public class Solution {
public static void main(String[] args) {
}
public static Planet thePlanet;
static {
try {
readKeyFromConsoleAndInitPlanet();
} catch (IOException e) {
e.printStackTrace();
}
}
public static void readKeyFromConsoleAndInitPlanet() throws IOException {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
String s = bufferedReader.readLine();
switch (s) {
case Planet.SUN: {
thePlanet = (Planet) Sun.getInstance();
break;
}
case Planet.MOON: {
thePlanet = (Planet) Moon.getInstance();
break;
}
case Planet.EARTH: {
thePlanet = (Planet) Earth.getInstance();
break;
}
default: {
thePlanet = null;
}
}
}
}