Java multithreading 🧶

Published: 22 June 2020
on channel: Bro Code
129,951
5.2k

Java multithreading tutorial

#java #multithreading #tutorial

//***************************************************************
public class Main{

public static void main(String[] args) throws InterruptedException{

// Create a subclass of Thread
MyThread thread1 = new MyThread();

//or

//implement Runnable interface and pass instance as an argument to Thread()
MyRunnable runnable1 = new MyRunnable();
Thread thread2 = new Thread(runnable1);


//thread1.setDaemon(true);
//thread2.setDaemon(true);

thread1.start();
//thread1.join(); //calling thread (ex.main) waits until the specified thread dies or for x milliseconds
thread2.start();

//System.out.println(1/0);
}
}
//***************************************************************


On this page of the site you can watch the video online Java multithreading 🧶 with a duration of hours minute second in good quality, which was uploaded by the user Bro Code 22 June 2020, share the link with friends and acquaintances, this video has already been watched 129,951 times on youtube and it was liked by 5.2 thousand viewers. Enjoy your viewing!