Creating threads recursively

  • 18
  • Locked
1. Change the GenerateThread class to make it a thread. 2. Create a GenerateThread constructor, which must: 2.1. Call the superclass's constructor, passing the created thread's number as a String. Use createdThreadCount. 2.2. Start the current thread. 2.3. The thread numbers must start with 1. 3. O
You can't complete this task, because you're not signed in.
Comments (8)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Karas Java Developer
16 September, 00:05
Definitelly worth those 18 pices of Dark Matter. Simplification does it some pointers: remember using super() to send to parent class. Use String.valueOf to change int to String toString is just another methoth of GenerateThread If else statement in the run and voaila Completelly DRY Recursion... wait... that is paradoxical...
Justin Smith
Level 17 , Greenfield, USA, United States
10 September, 21:20
I liked this one. Recursion is fun.
Jurij Thmsn
Level 24 , Flensburg, Germany
22 March, 14:45
really tough exercise, just solved it by trying and sneaking in the help section. I wish, there would be an explanation of the code afterwards. pure confusion.
Level 18 , Sofia, Bulgaria
4 March, 21:39
4 attempts...changed something...did not see what...but it passed :D
Lex Icon
Level 17 , Sofia, Bulgaria
27 February, 12:22
Daaamn it...46 attempts before I realized what's the point of the entire program.
Oliver Heintz
Level 18 , Mustang, United States
8 February, 15:56
I guess I just don't understand how start() and run() work. I'm getting held up because it seems like if your run method creates a new GenerateThread, and GenerateThread increments createdThreadCount, that createdThreadCount would increase. I can't seem to get it to work that way.
Level 23 , Columbia, United States
14 August 2020, 01:18
Deceptively easy. Using a while loop with nested if statement messed up the answer even though output was the same (just different order). An if statement in the run() method was accepted.
Level 19
11 April 2020, 00:46
First it seemed so easy...