Skip to content

Commit f2278e5

Browse files
committed
simple threading
1 parent bd56162 commit f2278e5

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Thread_Synchronized/thread_1.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
public class thread_1{
2+
static void main(String[] args) {
3+
threads var_1 = new threads();
4+
5+
Thread t1 = new Thread(var_1);
6+
Thread t2 = new Thread(var_1);
7+
8+
t1.start();
9+
t2.start();
10+
}
11+
}
12+
13+
class threads implements Runnable{
14+
@Override
15+
public void run(){
16+
for (int i =0;i<=5;i++){
17+
System.out.println(i);
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)