-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultithread.java
More file actions
57 lines (51 loc) · 916 Bytes
/
multithread.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
*/import java.lang.*;
class a11 extends Thread
{
public void run()
{
for(int i=0;i<5;i++)
{
System.out.println(Thread.currentThread().getPriority());
}System.out.println();
}
}
class b111 extends Thread
{
public void run()
{
for(int j=0;j<5;j++)
{
System.out.println("thread 2");
}
}
}
class c1 extends Thread
{
public void run()
{
for(int j=0;j<5;j++)
{
System.out.println("thread 3");
}
}
}
public class multithread
{
public static void main(String args[])
{
a11 obj=new a11();
b111 obj1=new b111();
c obj2=new c();
obj.start();
obj2.setPriority(Thread.MAX_PRIORITY);
obj2.start();
obj1.start();
}
}