My program seems to fulfill all the requirements, it recursively creates and displays 15 threads following the listed instruction. Yet if you notice the test requirements, my program is still failing. Any help would be appreciated.
package com.codegym.task.task16.task1623;
/*
Creating threads recursively
*/
public class Solution {
static int count = 15;
static volatile int createdThreadCount = 0;
public static void main(String[] args) {
System.out.println(new GenerateThread());
}
public static class GenerateThread extends Thread {
public GenerateThread() {
super(String.valueOf(++createdThreadCount));
start();
if (createdThreadCount < count) {
System.out.println(new GenerateThread());
}
}
@Override
public String toString() {
return getName() + " created";
}
}
}