I found a collection of tasks and solves it in java for the sake of interest. Faced a problem.
switch (input) { case 1: System.out.print(ts.task_1()); break; case 2: ts.task_2(); break; case 3: ts.task_3(); break; case 4: ts.task_4(); break; //и так далее до 1000 Is it possible to somehow change the approach to the implementation of the class to call tasks in large quantities?
HashMap<Int, Runnable>- rjhdby