网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
多选题
Which two of statements are true?()
A

It is possible to synchronize static methods.

B

When a thread has yielded as a result of yield(), it releases its locks.

C

When a thread is sleeping as a result of sleep(), it releases its locks.

D

The Object.wait() method can be invoked only from a synchronized context.

E

The Thread.sleep() method can be invoked only from a synchronized context.

F

When the thread scheduler receives a notify() request, and notifies a thread, that thread immediately releases its lock.


参考答案

参考解析
解析: 暂无解析
更多 “多选题Which two of statements are true?()AIt is possible to synchronize static methods.BWhen a thread has yielded as a result of yield(), it releases its locks.CWhen a thread is sleeping as a result of sleep(), it releases its locks.DThe Object.wait() method can be invoked only from a synchronized context.EThe Thread.sleep() method can be invoked only from a synchronized context.FWhen the thread scheduler receives a notify() request, and notifies a thread, that thread immediately releases its lock.” 相关考题
考题 GiventhatTriangleimplementsRunnable,and:Whichtwostatements,insertedindependentlyatbothlines35and41,tendtoallowboththreadstotemporarilypauseandallowtheotherthreadtoexecute?() A.Thread.wait();B.Thread.join();C.Thread.yield();D.Thread.sleep(1);E.Thread.notify();

考题 Given that t1 is a reference to a live thread, which is true?() A.The Thread.sleep() method can take t1 as an argument.B.The Object.notify() method can take t1 as an argument.C.The Thread.yield() method can take t1 as an argument.D.The Thread.setPriority() method can take t1 as an argument.E.The Object.notify() method arbitrarily chooses which thread to notify.

考题 Which two options describe how MySQL Server allocates memory?() A.Thread memory is pre-allocated up to thread_cache_size for performanceB.Each connection may have its own per-thread memory allocationsC.Global memory resources are allocated at server startupD.Each thread allocates memory from a global pool

考题 Which two CANNOT directly cause a thread to stop executing?()A、 Calling the yield method.B、 Calling the wait method on an object.C、 Calling the notify method on an object.D、 Calling the notifyAll method on an object.E、 Calling the start method on another Thread object.

考题 Which two of statements are true?()A、It is possible to synchronize static methods.B、When a thread has yielded as a result of yield(), it releases its locks.C、When a thread is sleeping as a result of sleep(), it releases its locks.D、The Object.wait() method can be invoked only from a synchronized context.E、The Thread.sleep() method can be invoked only from a synchronized context.F、When the thread scheduler receives a notify() request, and notifies a thread, that thread immediately releases its lock.

考题 public class A extends Thread {  A() {  setDaemon(true);  }  public void run() {  (new B()).start();  try {  Thread.sleep(60000);  } catch (InterruptedException x) {}  System.out.println(“A done”);  }  class B extends Thread {  public void run() {  try {  Thread.sleep(60000);  } catch (InterruptedException x) {}  System.out.println(“B done”);  }  }  public static void main(String[] args) {  (new A()).start();  }  }   What is the result?()  A、 A doneB、 B doneC、 A done B doneD、 B done A doneE、 There is no exception that the application will print anything.F、 The application outputs “A done” and “B done”, in no guaranteed order.

考题 Which statements concerning the methods notify() and notifyAll() are true?  A、Instances of class Thread have a method called notify().B、A call to the method notify() will wake the thread that currently owns the monitor of the object.C、The method notify() is synchronized.D、The method notifyAll() is defined in class Thread.E、When there is more than one thread waiting to obtain the monitor of an object, there is no way to be  sure which thread will be notified by the notify() method.

考题 Given that t1 is a reference to a live thread, which is true?()A、The Thread.sleep() method can take t1 as an argument.B、The Object.notify() method can take t1 as an argument.C、The Thread.yield() method can take t1 as an argument.D、The Thread.setPriority() method can take t1 as an argument.E、The Object.notify() method arbitrarily chooses which thread to notify.

考题 public class TestOne {  public static void main (String[] args) throws Exception {  Thread.sleep(3000);  System.out.println(”sleep”);  }  }  What is the result?() A、 Compilation fails.B、 An exception is thrown at runtime.C、 The code executes normally and prints “sleep”.D、 The code executes normally, but nothing is printed.

考题 public class TestSeven extends Thread {  private static int x;  public synchronized void doThings() {  int current = x;  current++;  x = current;  }  public void run() {  doThings();  }  }  Which is true?() A、 Compilation fails.B、 An exception is thrown at runtime.C、 Synchronizing the run() method would make the class thread-safe.D、 The data in variable “x” are protected from concurrent access problems.E、 Declaring the doThings() method as static would make the class thread-safe.F、 Wrapping the statements within doThings() in a synchronized(new Object()) {} block would make the class thread-safe.

考题 Which statement is true?()   A、 If only one thread is blocked in the wait method of an object, and another thread executes the modify on that same object, then the first thread immediately resumes execution.B、 If a thread is blocked in the wait method of an object, and another thread executes the notify method on the same object, it is still possible that the first thread might never resume execution.C、 If a thread is blocked in the wait method of an object, and another thread executes the notify method on the same object, then the first thread definitely resumes execution as a direct and sole consequence of the notify call.D、 If two threads are blocked in the wait method of one object, and another thread executes the notify method on the same object, then the first thread that executed the wait call first definitely resumes execution as a direct and sole consequence of the notify call.

考题 Which two statements are true?()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 ofdeadlocking by insertinginvocations of Thread.yield().

考题 Which two statements are true about setting the per-thread buffers higher than required?()A、More memory per thread is beneficial in all scenariosB、It causes increased overhead due to initial memory allocationC、It can affect system stability during peak load times, due to swappingD、It requires increasing the thread_cache_size variable

考题 Which two statements are true?()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().

考题 Which two options describe how MySQL Server allocates memory?()A、Thread memory is pre-allocated up to thread_cache_size for performanceB、Each connection may have its own per-thread memory allocationsC、Global memory resources are allocated at server startupD、Each thread allocates memory from a global pool

考题 多选题Which two can directly cause a thread to stop executing?()AExiting from a synchronized block.BCalling the wait method on an object.CCalling the notify method on an object.DCalling the notifyAll method on an object.ECalling the setPriority method on a thread object.

考题 多选题Which two CANNOT directly cause a thread to stop executing?()ACalling the yield method.BCalling the wait method on an object.CCalling the notify method on an object.DCalling the notifyAll method on an object.ECalling the start method on another Thread object.

考题 多选题Which statements concerning the methods notify() and notifyAll() are true?AInstances of class Thread have a method called notify().BA call to the method notify() will wake the thread that currently owns the monitor of the object.CThe method notify() is synchronized.DThe method notifyAll() is defined in class Thread.EWhen there is more than one thread waiting to obtain the monitor of an object, there is no way to be  sure which thread will be notified by the notify() method.

考题 多选题Which two of statements are true?()AIt is possible to synchronize static methods.BWhen a thread has yielded as a result of yield(), it releases its locks.CWhen a thread is sleeping as a result of sleep(), it releases its locks.DThe Object.wait() method can be invoked only from a synchronized context.EThe Thread.sleep() method can be invoked only from a synchronized context.FWhen the thread scheduler receives a notify() request, and notifies a thread, that thread immediately releases its lock.

考题 多选题Which two CANNOT directly cause a thread to stop executing? ()AExisting from a synchronized block.BCalling the wait method on an object.CCalling notify method on an object.DCalling read method on an InputStream object.ECalling the SetPriority method on a Thread object.

考题 多选题Which two can be used to create a new Thread?()AExtend java.lang.Thread and override the run method.BExtend java.lang.Runnable and override the start method.CImplement java.lang.thread and implement the run method.DImplement java.lang.Runnable and implement the run method.EImplement java.lang.Thread and implement the start method.

考题 多选题Which of the following statements about authentication responses and conditions is true?()(Choose two.)AWhen a router receives a failure response, it stops querying authentication methods.BWhen a router receives an error response, it stops querying authentication methods.CIf the router receives a failure response from an authentication method, it queries the next method.DThe router does not differentiate between failure and error responses; the authentication process is always interrupted.EIf it receives no response from the authentication method, a router will determine the error condition on its own; the router also has the option to proceed to the next method in a list if configured accordingly.

考题 多选题Which two statements are true?()AIt is possible for more than two threads to deadlock at once.BThe JVM implementation guarantees that multiple threads cannot enter into a deadlocked state.CDeadlocked threads release once their sleep() method's sleep duration has expired.DDeadlocking can occur only when the wait(), notify(), and notifyAll() methods are used incorrectly.EIt is possible for a single-threaded application to deadlock if synchronized blocks are used incorrectly.FIf a piece of code is capable of deadlocking, you cannot eliminate the possibility of deadlocking by inserting invocations of Thread.yield().

考题 多选题Which two statements are true about setting the per-thread buffers higher than required?()AMore memory per thread is beneficial in all scenariosBIt causes increased overhead due to initial memory allocationCIt can affect system stability during peak load times, due to swappingDIt requires increasing the thread_cache_size variable

考题 多选题Which two code fragments will execute the method doStuff() in a separate thread?()Anew Thread() {public void run() { doStuff(); }};Bnew Thread() {public void start() { doStuff(); }};Cnew Thread() {public void start() { doStuff(); }}.run();Dnew Thread() {public void run() { doStuff(); }}.start();Enew Thread(new Runnable() {public void run() { doStuff(); }}).start();

考题 单选题public class A extends Thread {  A() {  setDaemon(true);  }  public void run() {  (new B()).start();  try {  Thread.sleep(60000);  } catch (InterruptedException x) {}  System.out.println(“A done”);  }  class B extends Thread {  public void run() {  try {  Thread.sleep(60000);  } catch (InterruptedException x) {}  System.out.println(“B done”);  }  }  public static void main(String[] args) {  (new A()).start();  }  }   What is the result?()A  A doneB  B doneC  A done B doneD  B done A doneE  There is no exception that the application will print anything.F  The application outputs “A done” and “B done”, in no guaranteed order.

考题 多选题Which two options describe how MySQL Server allocates memory?()AThread memory is pre-allocated up to thread_cache_size for performanceBEach connection may have its own per-thread memory allocationsCGlobal memory resources are allocated at server startupDEach thread allocates memory from a global pool

考题 多选题Which two statements are true about using the isUserInRole method to implement security in a Java EEapplication?()AIt can be invoked only from the doGet or doPost methods.BIt can be used independently of the getRemoteUser method.CCan return true even when its argument is NOT defined as a valid role name in the deployment descriptor.DUsing the isUserInRole method overrides any declarative authentication related to the method in which it is invoked.