CodeGym /Java Course /Java Multithreading /Practice with thread priority

Practice with thread priority

Java Multithreading
Level 8 , Lesson 6
Available

"Hi, Amigo!"

9
Task
Java Multithreading, level 8, lesson 6
Locked
Magic class
In the java.util.concurrent package, find a List implementation that has the following characteristics: 1. The iterator doesn't contain any data added to the list after the iterator's creation; 2. Data is stored internally as an array.
16
Task
Java Multithreading, level 8, lesson 6
Locked
Thread priorities
In a separate file, create a class called MyThread that inherits Thread. MyThread must: 1. Be able to be created using any of the superclass's constructors (Alt+Insert). 2. Thread priorities must be set using a loop—from the minimum to the maximum value.
Comments (5)
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION
KIN SOCHEAT Level 34, Phnom Penh, Cambogia
16 July 2020
nice thanks
12 May 2020
For the second task get rid of (last) constructor: // public MyThread(ThreadGroup group, Runnable target, String name, long stackSize, boolean inheritThreadLocals) { // super(group, target, name, stackSize, inheritThreadLocals); // setPriority(priorityIncrement()); // }
Wei Cui Level 39, Newark, United States
6 April 2020
first task

//change list 
List<String> list = new CopyOnWriteArrayList<>();
Denys Level 41, Ukraine
2 March 2021
This hint is too much explicit :))
Szymon Level 41, Warsaw, Poland
5 May 2021
You ruined the fun man.