Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Presentation code for Multithreading
- * Date : 01.08.19
- */
- package Multithreading;
- class A extends Thread {
- public void run(){
- for(int i = 20; i < 30; i++){
- System.out.println(i);
- }
- }
- }
- class B extends Thread {
- public void run(){
- for(int i = 40; i < 50; i++){
- System.out.println(i);
- }
- }
- }
- class C extends Thread {
- public void run(){
- for(int i = 60; i < 70; i++){
- System.out.println(i);
- }
- }
- }
- public class TestThreads {
- public static void main(String[] args){
- A ob1 = new A();
- B ob2 = new B();
- C ob3 = new C();
- ob1.start();
- ob2.start();
- ob3.start();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement