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!
(Java)
(Java)
(Java)
(Java)
(Java)
(Java)
java.lang.Object
+ - java.lang.Throwable
+ - java.lang.Exception
+ - java.lang.RuntimeException
+ - java.lang.IndexOutOfBoundsException
+ - java.lang.StringIndexOutOfBoundsException
+ - java.lang.ArrayIndexOutOfBoundsException
У методі testSomеValue
можуть бути порушені виключення StringIndexOutOfBoundsException і
ArrayIndexOutOfBoundsException , при цьому вони не обробляються в блоці try – catch .
Яке з перерахованих нижче тверджень буде вірним?
(Java)
1 class A extends B {
2 ...
3 }
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 unlock () {
synchronized (lock) {
lock.notify ();
System.out.print ( "2");
}
}
public static void main (String s []) {
new Thread (new SomeClass () {
public void run () {
lock ();
}
}). Start ();
new Thread (new SomeClass () {
public void run () {
unlock ();
}
}). Start ();
}
}
(Java)