Don't know how else to put it. This is what I came up with. Nothing prints out at all. I have a suspicion that the problem is that the start() method has been overridden, and since it's not actually calling start() but my custom start(threadName) method, it isn't actually turning it into a thread. It also does not recognize the regular start() anymore for the TaskManipulator class when I tried this.start() or super.start().
When googling about how to run a thread if the start() method has been overridden, the responses basically said "never override the start method", haha.
package com.codegym.task.task25.task2508;
/*
No goofing off
*/
public class Solution
{
/*
Output:
first
first
second
second
second
third
fifth
*/
public static void main(String[] args) throws InterruptedException
{
CustomThreadManipulator manipulator = new TaskManipulator();
manipulator.start("first");
Thread.sleep(150);
manipulator.stop();
manipulator.start("second");
Thread.sleep(250);
manipulator.stop();
manipulator.start("third");
Thread.sleep(50);
manipulator.stop();
manipulator.start("forth");
manipulator.stop();
manipulator.start("fifth");
Thread.sleep(1);
manipulator.stop();
}
}