Java multithreading 🧶

Publié le: 22 juin 2020
sur la chaîne: 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);
}
}
//***************************************************************


Sur cette page du site, vous pouvez voir la vidéo en ligne Java multithreading 🧶 durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Bro Code 22 juin 2020, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 129,951 fois et il a aimé 5.2 mille téléspectateurs. Bon visionnage!