mentor suggestions
You aren't interrupting threads in the "TIMED_WAITING" state.
You are calling isInterrupted on more than just threads in the "RUNNABLE" state.
package com.codegym.task.task25.task2504;
/*
A switch for threads
*/
public class Solution {
public static void processThreads(Thread... threads) {
// Implement this method
for(Thread t : threads) {
switch(t.getState()) {
case NEW : t.start();
case TIMED_WAITING : t.interrupt();
case WAITING : t.interrupt();
case RUNNABLE : t.isInterrupted();
case BLOCKED : System.out.println(t.getPriority());
}
}
}
public static void main(String[] args) {
}
}