Загрузка страницы

Java multithreading 🧶

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);
}
}
//***************************************************************

Видео Java multithreading 🧶 канала Bro Code
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
23 июня 2020 г. 6:30:04
00:15:18
Яндекс.Метрика