//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");
}
}
}
*/