Advertisement
sergAccount

Untitled

Mar 14th, 2021
680
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package com.mycompany.app21;
  7.  
  8. /**
  9.  *
  10.  * @author Admin
  11.  */
  12. public class Main2 {
  13.  
  14.     public static void main(String[] args) {
  15.         // создаем поток и выполняем MyLongTask в отдельном потоке (в асинх-м режиме)
  16.         Thread th1 = new Thread(new MyLongTask());
  17.         // запускаем th1
  18.         th1.start();
  19.         try {
  20.             Thread.sleep(8000);
  21.         } catch (InterruptedException ex) {
  22.             ex.printStackTrace();
  23.         }
  24.         System.out.println("I am here!!!!");
  25.     }
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement