//If you were of the world, the world would love its own. But because you are not of the world, //since I chose you out of the world, therefore the world hates you (John 15:19) package com.javarush.task.task16.task1603; import java.util.ArrayList; import java.util.List; /* Список и нити */ public class Solution { public static volatile List list = new ArrayList(5); public static void main(String[] args) { SpecialThread thread0 = new SpecialThread();//Add your code here - добавьте свой код тут SpecialThread thread1 = new SpecialThread(); SpecialThread thread2 = new SpecialThread(); SpecialThread thread3 = new SpecialThread(); SpecialThread thread4 = new SpecialThread(); list.add(new Thread(thread0)); list.add(new Thread(thread1)); list.add(new Thread(thread2)); list.add(new Thread(thread3)); list.add(new Thread(thread4)); } public static class SpecialThread implements Runnable { public void run() { System.out.println("it's a run method inside SpecialThread"); } } } /* Список и нити В методе main добавить в статический объект list 5 нитей. Каждая нить должна быть новым объектом класса Thread, работающим со своим объектом класса SpecialThread. Требования: 1. В методе main создай 5 объектов типа SpecialThread. 2. В методе main создай 5 объектов типа Thread. 3. Добавь 5 разных нитей в список list. 4. Каждая нить из списка list должна работать со своим объектом класса SpecialThread. 5. Метод run класса SpecialThread должен выводить "it's a run method inside SpecialThread". package com.javarush.task.task16.task1603; import java.util.ArrayList; import java.util.List; * Список и нити * public class Solution { public static volatile List list = new ArrayList(5); public static void main(String[] args) { //Add your code here - добавьте свой код тут } public static class SpecialThread implements Runnable { public void run() { System.out.println("it's a run method inside SpecialThread"); } } } */