logo

Crowdly

Browser

Add to Chrome

Результат компіляції програмного коду: public class NewThreadThree implem...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Результат

компіляції програмного коду:

public class NewThreadThree implements Runnable {

       String name;

       Thread t;

      

       NewThreadThree (String threadname){

             name = threadname;

             t = new Thread (this, name);

             t.start();

       }

 

       public void run() {

             try {

                    System.out.println("Виконання потоку "+ name);

                          Thread.sleep(200);

             }catch (InterruptedException e) {

                    System.out

.println(name + "

перервано");

             }

             System.out

.println(name + "

завершено");

       }

}

 

public class NewThreadThreeMain {

 

       public static void main(String[] args) {

             new NewThreadThree("Один");

             new NewThreadThree("Два");

 

             try {

                    Thread.sleep(1000);

             } catch (InterruptedException e) {

                    System.out.println("Головний потік перервано");

             }

             System.out.println("Головний потік завершено");

       }

}

0%
0%
0%
More questions like this

Want instant access to all verified answers on virt.ldubgd.edu.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome