logo

Crowdly

Browser

Add to Chrome

Програмування мовою Java

Looking for Програмування мовою Java test answers and solutions? Browse our comprehensive collection of verified answers for Програмування мовою Java at moodle.chnu.edu.ua.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

Яким буде результат роботи наступного коду?

public abstract class SomeClass implements Runnable {

private Object lock = new Object ();

public void lock () {

synchronized (lock) {

try {

lock.wait ();

System.out.print ( "1");

} Catch (InterruptedException e) { }

}

}

public void notifyThread () {

synchronized (lock) {

lock.notify ();

}

}

public void unlock () {

synchronized (lock) {

lock.notify ();

System.out.print ( "2");

}

}

public static void main (String s []) {

Thread t = new Thread (new SomeClass () {

public void run () {

lock ();

try {

Thread.sleep (1000);

} Catch (InterruptedException e) { }

notifyThread ();

}

});

t.start ();

Thread t1 = new Thread (new SomeClass () {

public void run () {

unlock ();

}

});

t1.start ();

}

}

(Java)

0%
0%
0%
0%
0%
0%
View this question
Які твердження щодо java.util.Properties коректні?

(Java)

View this question
Які твердження щодо класу BufferedOutputStream вірні?

(Java)

100%
100%
View this question
Які твердження щодо java.util.Comparator коректні?

(Java)

0%
View this question
Які твердження щодо класу TimeZone вірні?

(Java)

0%
0%
0%
0%
View this question
Як встановити розмір компонента AWT ?

(Java)

View this question
Який клас дозволяє повернути у вхідний потік лічені з нього дані?

(Java)

View this question
Які твердження щодо класу Canvas вірні?

(Java)

View this question
Які класи надають методи для запису в потік двійкового представлення значень примітивних типів Java?

(Java)

View this question
Які переваги дає многопоточная архітектура?

(Java)

100%
100%
100%
100%
0%
0%
View this question

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