Почему не проходит?
package com.javarush.task.task16.task1623;
/*
Рекурсивное создание нитей
*/
public class Solution {
static int count = 15;
static volatile int createdThreadCount = 0;
public static void main(String[] args) throws InterruptedException {
for (int i = 0; i < count; i++) {
new GenerateThread();
}
}
public static class GenerateThread extends Thread {
public GenerateThread(){
super(String.valueOf(++createdThreadCount));
start();
}
public void run() {
if (createdThreadCount <=count){
System.out.println(this);
}
}
public String toString() {
return Thread.currentThread().getName() + " created";
}
}
}