There was an error while loading. Please reload this page.
1 parent 35b3144 commit eec5539Copy full SHA for eec5539
Multithreading.java
@@ -0,0 +1,17 @@
1
+class MyThread extends Thread {
2
+ public void run() {
3
+ for (int i = 1; i <= 5; i++) {
4
+ System.out.println("Thread " + Thread.currentThread().getId() + " - Count " + i);
5
+ }
6
7
+}
8
+
9
+public class MultiThreadDemo {
10
+ public static void main(String[] args) {
11
+ MyThread thread1 = new MyThread();
12
+ MyThread thread2 = new MyThread();
13
14
+ thread1.start();
15
+ thread2.start();
16
17
0 commit comments