2/10 questions · Unlock full access
Q1Multiple answers

Given:public class Threads2 implements Runnable {public void run() {System.out.println("run.");throw new RuntimeException("Problem");}public static void main(String[] args) {Thread t = new Thread(new Threads2());t.start();System.out.println("End of method.");}}Which two can be results? (Choose two.) A.java.lang.RuntimeException: ProblemB.run. java.lang.RuntimeException: ProblemC.End of method. java.lang.RuntimeException: ProblemD.End of method. run. java.lang.RuntimeException: ProblemE.run. java.lang.RuntimeException: Problem

Q2Multiple answers

Which two statements are true? (Choose two.) A.It is possible for more than two threads to deadlock at once.B.The JVM implementation guarantees that multiple threads cannot enter into a deadlocked state.C.Deadlocked threads release once their sleep() method's sleep duration has expired.D.Deadlocking can occur only when the wait(), notify(), and notifyAll() methods are used incorrectly.E.It is possible for a single-threaded application to deadlock if synchronized blocks are used incorrectly.F.If a piece of code is capable of deadlocking, you cannot eliminate the possibility of deadlocking by inserting invocations of Thread.yield().