шпаргалки
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

31 lines
846 B

/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mt;
/**
*
* @author (C)Y.D.Zakovryashin, 09.01.2023
*/
public class DemoThread {
public static void main(String[] args) {
SimpleThread t1 = new SimpleThread('*', 10);
SimpleThread t2 = new SimpleThread('a', 10);
SimpleThread t3 = new SimpleThread('$', 10);
Thread mt = new Thread(t1, "First");
Thread m1 = new Thread(t2, "Second");
Thread m2 = new Thread(t3, "Third");
m2.setPriority(2);
mt.setPriority(7);
mt.start();
m1.start();
m2.start();
System.out.println(m2.getId() + "." + m2.getName() + ", "
+ m2.getPriority());
}
}