Підкажіть , що не так?
package com.javarush.task.task15.task1522;
import java.util.Scanner;
/*
Закрепляем паттерн Singleton
*/
public class Solution {
public static void main(String[] args) {
}
public static Planet thePlanet;
//add static block here - добавьте статический блок тут
static {
readKeyFromConsoleAndInitPlanet();
}
public static void readKeyFromConsoleAndInitPlanet() {
// implement step #5 here - реализуйте задание №5 тут
Scanner sc = new Scanner(System.in);
String line = sc.nextLine();
switch (line) {
case "sun"-> thePlanet = Sun.getInstance();
case "moon" -> thePlanet = Moon.getInstance();
case "earth" -> thePlanet = Earth.getInstance();
}
}
}