Tests: Метод Thread.yield()

Check your knowledge — 20 questions

Progress 1/20

Question 1 of 20

Дано:

3. class Chicks {
4.    synchronized void yack(long id) {
5.       for(int x = 1; x < 3; x++) {
6.          System.out.print(id + " ");
7.          Thread.yield();
8.       }
9.    }
10. }
11. public class ChicksYack implements Runnable {
12.     Chicks c;
13.     public static void main(String[] args) {
14.         new ChicksYack().go();
15.     }
16.     void go() {
17.        c = new Chicks();
18.        new Thread(new ChicksYack()).start();
19.        new Thread(new ChicksYack()).start();
20.     }
21.     public void run() {
22.        c.yack(Thread.currentThread().getId());
23.     }
24. }

Какие утверждения верны? (Выберите все подходящие.)

Select all that apply.

0 selected