-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIkesh.java
More file actions
93 lines (88 loc) · 1.39 KB
/
Ikesh.java
File metadata and controls
93 lines (88 loc) · 1.39 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
class himanboss implements Runnable
{
@Override
public void run()
{
int c=0;
try
{
while(true)
{
System.out.println(c+" seconds");
Thread.sleep(1000);
++c;
c=c%60;
}
}
catch(InterruptedException e)
{
System.out.println("Error");
}
}
}
class jerinboss implements Runnable
{
@Override
public void run()
{
int c=0;
try
{
while(true)
{
System.out.println(c+" minutes");
Thread.sleep(60000);
++c;
c=c%60;
}
}
catch(InterruptedException e)
{
System.out.println("Error");
}
}
}
class amanboss implements Runnable
{
@Override
public void run()
{
int c=0;
try
{
while(true)
{
System.out.println(c+" hours");
Thread.sleep(3600000);
++c;
c=c%24;
}
}
catch(InterruptedException e)
{
System.out.println("Error");
}
}
}
public class Ikesh
{
public static void main(String args[])
{
Thread t1=new Thread(new himanboss());
Thread t2=new Thread(new jerinboss());
Thread t3=new Thread(new amanboss());
t1.start();
t2.start();
t3.start();
try
{
t1.join();
t2.join();
t3.join();
}
catch(InterruptedException e)
{
System.out.println("Error");
}
}
}