Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Main {
- public static void main(String[] args) {
- MyThread thread = new MyThread();
- thread.start();
- Thread t1 = new Thread(new MyNewThread());
- t1.start();
- System.out.println("End of program");
- }
- }
- class MyThread extends Thread {
- @Override
- public void run() {
- System.out.println("Thread is running");
- }
- }
- class MyNewThread implements Runnable {
- @Override
- public void run() {
- System.out.println("New Thread is running");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement