/
alexShibanov
/
556677
Обзор
Документация
Войти
/
alexShibanov
/
556677
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
Multithread.java
25 строк
678 B
infinityXgojo
Create Multithread.java
13 окт 2023, 06:56
Не верифицирован
13 окт 2023, 06:56
8e7e56a
Код
Авторство
О чём код?
class MultithreadExm implements Runnable { public void run() { try { // It shows that thread is running System.out.println( "The thread " + Thread.currentThread().getId() + " is currently running"); } catch (Exception e) { System.out.println("Catching exception"); } } } class multithrdexp { public static void main(String[] args) { int n = 5; // Number of threads for (int i = 0; i < n; i++) { Thread object = new Thread(new MultithreadExm()); object.start(); } } }