Java multithreading 🧶

Pubblicato il: 22 giugno 2020
sul canale di: 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);
}
}
//***************************************************************


In questa pagina del sito puoi guardare il video online Java multithreading 🧶 della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Bro Code 22 giugno 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 129,951 volte e gli è piaciuto 5.2 mille spettatori. Buona visione!