Can anyone see what I am doing wrong?
package de.codegym.task.task15.task1522;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
/*
Singleton-Muster festigen
*/
public class Solution {
public static void main(String[] args) {
}
public static Planet thePlanet;
// Hier statischen Block einfügen
static {
try{
readKeyFromConsoleAndInitPlanet();}
catch(Exception e){
}
}
public static void readKeyFromConsoleAndInitPlanet() throws Exception{
// Hier Schritt #5 implementieren
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s = reader.readLine();
if(s.equals("Sonne")){
Planet thePlanet = Sun.getInstance();
}
else if(s.equals("Mond")){
Planet thePlanet = Moon.getInstance();
}
else if(s.equals("Erde")){
Planet thePlanet = Earth.getInstance();
}
else{
Planet thePlanet = null;
}
}
}