- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultithread.java
More file actions
Latest commit
57 lines (51 loc) · 916 Bytes
/
Copy pathmultithread.java
File metadata and controls
57 lines (51 loc) · 916 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author g1.test1
*/importjava.lang.*;
classa11extendsThread
{
publicvoidrun()
{
for(inti=0;i<5;i++)
{
System.out.println(Thread.currentThread().getPriority());
}System.out.println();
}
}
classb111extendsThread
{
publicvoidrun()
{
for(intj=0;j<5;j++)
{
System.out.println("thread 2");
}
}
}
classc1extendsThread
{
publicvoidrun()
{
for(intj=0;j<5;j++)
{
System.out.println("thread 3");
}
}
}
publicclassmultithread
{
publicstaticvoidmain(Stringargs[])
{
a11obj=newa11();
b111obj1=newb111();
cobj2=newc();
obj.start();
obj2.setPriority(Thread.MAX_PRIORITY);
obj2.start();
obj1.start();
}
}