- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunnab.java
More file actions
Latest commit
42 lines (40 loc) · 686 Bytes
/
Copy pathrunnab.java
File metadata and controls
42 lines (40 loc) · 686 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
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author g1.test1
*/
classaimplementsRunnable
{
publicvoidrun()
{
for(inti=0;i<5;i++)
{
System.out.println("thread 1");
}System.out.println();
}
}
classbimplementsRunnable
{
publicvoidrun()
{
for(intj=0;j<5;j++)
{
System.out.println("thread 2");
}
}
}
publicclassrunnab
{
publicstaticvoidmain(Stringargs[])
{
aobj=newa();
bobj1=newb();
Threadobj4=newThread(obj1);
obj4.start();
Threadobj3=newThread(obj);
obj3.start();
}
}