Created
October 30, 2020 09:48
-
-
Save neer2808/7a2edba2c81a1313db5450f82644103f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyThread10 extends Thread | |
{ | |
public void run() { | |
for (int i = 0; i < 10; i++) { | |
try { | |
Thread.sleep(1000); | |
} catch (InterruptedException e) { | |
e.printStackTrace(); | |
} | |
System.out.println("myThread10"); | |
} | |
} | |
} | |
public class ThreadDemo4 { | |
public static void main(String[] args) { | |
MyThread10 obj = new MyThread10(); | |
obj.start(); | |
for (int i = 0; i <10 ; i++) { | |
System.out.println("inside the main thread"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment