Java multithreading 🧶

Publicado em: 22 Junho 2020
no canal de: 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);
}
}
//***************************************************************


Nesta página do site você pode assistir ao vídeo on-line Java multithreading 🧶 duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Bro Code 22 Junho 2020, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 129,951 vezes e gostou 5.2 mil espectadores. Boa visualização!