Finding and starting a thread

Report a typo

Implement a method that takes an array of threads. The method must find the first thread that has not been started yet and start it.

The found thread must be terminated before the implemented method is completed.

The testing system will give you some hints throwing exceptions in the main thread, like:

Exception in thread "main" java.lang.RuntimeException: Found thread must be terminated before ending the implemented method
Write a program in Java 17
class ThreadProcessor {
public static void findAndStartThread(Thread... threads) throws InterruptedException {
// implement this method
}
}
___

Create a free account to access the full topic