import java.util.Objects; import java.util.Scanner; public class Program { public static void main(String[] args) { Plans MyPlan = new Plans(); while (true){ System.out.println("Введите команду:"); Scanner scanner = new Scanner(System.in); String com = scanner.nextLine(); switch (com){ case "#write": System.out.println("Введите ваши планы на сегодня: "); String write = scanner.nextLine(); String[] words = write.split(" "); MyPlan.Write(words); break; case "#read": MyPlan.Read(); break; default: throw new IllegalStateException("Unexpected value: " + com); } } } }