It tells me that the task doesn't compile on the server.
I have the right output, it complies at home so I guess it's a bug?
Error in com/codegym/task/task28/task2805/MyThread.java on line 95
no suitable constructor found for Thread(java.lang.ThreadGroup,java.lang.Runnable,java.lang.String,long,boolean)
constructor java.lang.Thread.Thread() is not applicable
(actual and formal argument lists differ in length)
constructor java.lang.Thread.Thread(java.lang.Runnable) is not applicable
(actual and formal argument lists differ in length)
constructor java.lang.Thread.Thread(java.lang.Runnable,java.security.AccessControlContext) is not applicable
(actual and formal argument lists differ in length)
constructor java.lang.Thread.Thread(java.lang.ThreadGroup,java.lang.Runnable) is not applicable
(actual and formal argument lists differ in length)
constructor java.lang.Thread.Thread(java.lang.String) is not applicable
(actual and formal argument lists differ in length)
constructor java.lang.Thread.Thread(java.lang.ThreadGroup,java.lang.String) is not applicable
(actual and formal argument lists differ in length)
constructor java.lang.Thread.Thread(java.lang.Runnable,java.lang.String) is not applicable
(actual and formal argument lists differ in length)
constructor java.lang.Thread.Thread(java.lang.ThreadGroup,java.lang.Runnable,java.lang.String) is not applicable
(actual and formal argument lists differ in length)
constructor java.lang.Thread.Thread(java.lang.ThreadGroup,java.lang.Runnable,java.lang.String,long) is not applicable
(actual and formal argument lists differ in length)
package com.codegym.task.task28.task2805;
/*
Thread priorities
*/
public class Solution {
public static void main(String[] args) {
for (int i = 0; i < 12; i++) {
System.out.print(new MyThread().getPriority() + " ");
}
// Output
// 1 2 3 4 5 6 7 8 9 10 1 2
System.out.println();
ThreadGroup group = new ThreadGroup("someName");
group.setMaxPriority(7);
for (int i = 0; i < 12; i++) {
System.out.print(new MyThread(group, "name" + i).getPriority() + " ");
}
// Output
// 3 4 5 6 7 7 7 7 1 2 3 4
}
}