-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSeries.java
More file actions
87 lines (72 loc) · 1.39 KB
/
Series.java
File metadata and controls
87 lines (72 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
/**
*
*/
package Day9;
import java.util.*;
/**
* @author M.NAVEEN
* RANDOM CODER'S
* Tech/Project Lead Android Club
*/
public class Series
{
public Series()
{
}
public static void main(String[] args)
{
prints p=new prints();
p.setName("TH1");
p.start();
printss p2=new printss();
p2.setName("TH2");
p2.start();
}
}
class prints extends Thread{
public void run()
{
System.out.println("--------------------Number's Divisble By 3-----------------------------------");
int i=0;
while(true)
{ if(i%3==0)
System.out.println(i); i++;
try {
Thread.sleep(fibo.getfibo());
} catch (Exception e) {
System.out.println(e);
}
}
}
}
class printss extends Thread{
public void run()
{
System.out.println("English Aplhabets circular----");
int i=0;
while(true)
{
System.out.println("ALPHA :"+(char)(i+65));
i++;
i=i%26;
try {
Thread.sleep(fibo.getfibo());
} catch (Exception e) {
System.out.println(e);
}
}
}
}
class fibo{
public static int getfibo()
{ Random r=new Random();
int n = r.nextInt(100), t1 = 0, t2 = 1;
for (int i = 1; i <= n; ++i)
{
int sum = t1 + t2;
t1 = t2;
t2 = sum;
}
return t2;
}
}