Товарищи, почему не проходит? Не понимаю...
package com.javarush.task.task15.task1522;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/*
Закрепляем паттерн Singleton
*/
public class Solution {
public static void main(String[] args) {
}
public static Planet thePlanet;
static {
try {
readKeyFromConsoleAndInitPlanet();
} catch (IOException e) {
e.printStackTrace();
}
}
//add static block here - добавьте статический блок тут
public static void readKeyFromConsoleAndInitPlanet() throws IOException {
BufferedReader buff = new BufferedReader(new InputStreamReader(System.in));
String s = buff.readLine();
switch (s) {
case "sun" : thePlanet = Sun.getInstance();
break;
case "moon" : thePlanet = Sun.getInstance();
break;
case "earth" : thePlanet = Sun.getInstance();
break;
default: thePlanet = null;
}
// implement step #5 here - реализуйте задание №5 тут
}
}