Output is correct
package com.codegym.task.task16.task1603;
import java.util.ArrayList;
import java.util.List;
/*
A list and some threads
*/
public class Solution {
public static volatile List<Thread> list = new ArrayList<>(5);
public static void main(String[] args) {
//write your code here
SpecialThread t = new SpecialThread();
Thread y = new Thread(t);
list.add(y);
y.start();
SpecialThread a = new SpecialThread();
Thread z = new Thread(a);
list.add(z);
z.start();
SpecialThread aa = new SpecialThread();
Thread dd = new Thread(aa);
list.add(dd);
dd.start();
SpecialThread rcb = new SpecialThread();
Thread csk = new Thread(rcb);
list.add(csk);
csk.start();
SpecialThread kkr = new SpecialThread();
Thread rr = new Thread(kkr);
list.add(rr);
rr.start();
}
public static class SpecialThread implements Runnable {
public void run() {
System.out.println("This is the run method inside SpecialThread");
}
}
}