logo

Crowdly

Browser

Add to Chrome

Вкажіть можливий результат виконання наступного коду: public abstract class S...

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

Вкажіть можливий результат виконання наступного коду:

public abstract class SomeClass implements Runnable {

public final static Object one = new Object (), two = new Object ();

public static void main (String s []) {

Thread t1 = new Thread () {

public void run () {

synchronized (one) {

synchronized (two) {

System.out.print ( "1");

}

}

}

};

Thread t2 = new Thread () {

public void run () {

synchronized (two) {

try {

Thread.sleep (1000);

} Catch (InterruptedException e) {

e.printStackTrace ();

}

synchronized (one) {

System.out.print ( "2");

}

}

}

};

t1.start ();

t2.start ();

}

}

(Java)

0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on moodle.chnu.edu.ua?

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

Browser

Add to Chrome