单选题Given that t1 is a reference to a live thread, which is true?()AThe Thread.sleep() method can take t1 as an argument.BThe Object.notify() method can take t1 as an argument.CThe Thread.yield() method can take t1 as an argument.DThe Thread.setPriority() method can take t1 as an argument.EThe Object.notify() method arbitrarily chooses which thread to 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.


参考解析

解析: 暂无解析

相关考题:

( 24 )请阅读下面程序public class ThreadTest {public static void main ( String args[ ]){Thread t1 = new Thread ( new Hello ()):Thread t2 = new Thread ( new Hello ()):t l .start ():t2.start ();}}class Hello implements Runnable {int i ;public void run (){while ( true ) {System.out.println ( "Hello"+i++ ) ;if ( i=5 ) break :}}}该程序创建线程使用的方法是()A )继承 Thread 类B )实现 Runnable 接口C ) t l.start ()D ) t2.start ()

请阅读下面程序 public class ThreadTest{ public static void main(String args[]) ( Thread t1=new Thread(new Hello()); Thread t2=new Thread(new Hello()); t1.start(); t2.start(); } } class Hello implements Runnable { int i; public void run() { while(true) { System.out.prinfin("Hello"+i++); if(i=5) break; } } } 该程序创建线程使用的方法是A.继承Thread类B.实现Runnable接口C.t1.start()D.t2.start()

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

Given:Which statement is true about the class of an object that can reference the variable base? () A.It can be any class.B.No class has access to base.C.The class must belong to the geometry package.D.The class must be a subclass of the class Hypotenuse.

Which three statements are true when the listener handles connection requests to an Oracle 12cdatabase instance with multithreaded architecture enabled In UNIX?() A. Thread creation must be routed through a dispatcher processB. The local listener may spawn a now process and have that new process create a threadC. Each Oracle process runs an SCMN thread.D. Each multithreaded Oracle process has an SCMN thread.E. The local listener may pass the request to an existing process which in turn will create a thread.

下列程序的输出结果是______。 class T44 implements Runnable { public void run() { System.out.print in (Thread.currentThread ( ).getName ( ) + "运行" ); } } public class ex44 { public static void main(String[] args) { Thread t1 = new Thread(new T44(), "t1"); Thread t2 = new Thread(new T44 () , "t2"); t1 .setPriority(Thread. MAX_PRIORITY); t2.setPriority(Thread.MIN_PRIORITY); t2. start (); t1 .start (); } }A.t1 运行 t2 运行B.t2 运行 t1 运行C.t1 运行 t1 运行D.t2 运行 t2 运行

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 this method in a class:  public String toString() {  StringBuffer buffer = new StringBuffer();  buffer.append(‟‟);  buffer.append(this.name);  buffer.append(‟‟);  return buffer.toString();  }  Which is true?() A、 This code is NOT thread-safe.B、 The programmer can replace StringBuffer with StringBuilder with no other changes.C、 This code will perform well and converting the code to use StringBuilder will not enhance the performance.D、 This code will perform poorly. For better performance, the code should be rewritten: return ““+ this.name + “”;

Given the following code fragment:     public void create() {     Vector myVect;     myVect = new Vector();      }  Which of the following statements are true?() A、 The declaration on line 2 does not allocate memory space for the variable myVect.B、 The declaration on line 2 allocates memory space for a reference to a Vector object.C、 The statement on line 2 creates an object of class Vector.D、 The statement on line 3 creates an object of class Vector.E、 The statement on line 3 allocates memory space for an object of class Vector.

public class Test{  public static void main( String[] argv ){  // insert statement here  }  }   Which statement, inserted at line 3, produces the following output?()  Exception in thread “main” java.lang.AssertionError: true at Test.main(Test.java:3)  A、 assert true;B、 assert false;C、 assert false : true;D、 assert false == true;E、 assert false: false;

Which of the following statements are true?() A、 The equals() method determines if reference values refer to the same object.B、 The == operator determines if the contents and type of two separate objects match.C、 The equals() method returns true only when the contents of two objects match.D、 The class File overrides equals() to return true if the contents and type of two separate objects match.

Which statements concerning the effect of the statement gfx.drawRect(5, 5, 10, 10) are true, given that gfx is a reference to a valid Graphics object?()  A、The rectangle drawn will have a total width of 5 pixels.B、The rectangle drawn will have a total height of 6 pixels.C、The rectangle drawn will have a total width of 10 pixels.D、The rectangle drawn will have a total height of 11 pixels.

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 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 three statements are true when the listener handles connection requests to an Oracle 12cdatabase instance with multithreaded architecture enabled In UNIX?()A、Thread creation must be routed through a dispatcher processB、The local listener may spawn a now process and have that new process create a threadC、Each Oracle process runs an SCMN thread.D、Each multithreaded Oracle process has an SCMN thread.E、The local listener may pass the request to an existing process which in turn will create a thread.

用于作为真向或磁向的基准。()A、It is used as a reference to either true nor magnetic direction.B、It is used as a reference to either true or magnetic direction.C、It is used as a reference to neither true or magnetic direction.D、It is used as a reference to neither true nor magnetic direction.

多选题Given: Which three are true?()ACat is-a AnimalBCat is-a JumperCDog is-a AnimalDDog is-a JumperECat has-a AnimalFBeagle has-a Tail

多选题Which three statements are true when the listener handles connection requests to an Oracle 12cdatabase instance with multithreaded architecture enabled In UNIX?()AThread creation must be routed through a dispatcher processBThe local listener may spawn a now process and have that new process create a threadCEach Oracle process runs an SCMN thread.DEach multithreaded Oracle process has an SCMN thread.EThe local listener may pass the request to an existing process which in turn will create a thread.

单选题Given that t1 is a reference to a live thread, which is true?()AThe Thread.sleep() method can take t1 as an argument.BThe Object.notify() method can take t1 as an argument.CThe Thread.yield() method can take t1 as an argument.DThe Thread.setPriority() method can take t1 as an argument.EThe Object.notify() method arbitrarily chooses which thread to notify.

单选题Which statements concerning the effect of the statement gfx.drawRect(5, 5, 10, 10) are true, given that gfx is a reference to a valid Graphics object?()AThe rectangle drawn will have a total width of 5 pixels.BThe rectangle drawn will have a total height of 6 pixels.CThe rectangle drawn will have a total width of 10 pixels.DThe rectangle drawn will have a total height of 11 pixels.

多选题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.

多选题Given: 6. Which two successfully translate and result in a value of true?()A${true or false}B${requestScope[foo][0]  500}C${requestScope[’foo’][1] = 420}D${(requestScope[’foo’][0] lt 50)  (3 gt 2)}

单选题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.

单选题Given this method in a class:  public String toString() {  StringBuffer buffer = new StringBuffer();  buffer.append(‟‟);  return buffer.toString();  }  Which is true?()A This code is NOT thread-safe.B The programmer can replace StringBuffer with StringBuilder with no other changes.C This code will perform well and converting the code to use StringBuilder will not enhance the performance.D This code will perform poorly. For better performance, the code should be rewritten: return ““+ this.name + “”;

单选题public class Test{  public static void main( String[] argv ){  // insert statement here  }  }   Which statement, inserted at line 3, produces the following output?()  Exception in thread “main” java.lang.AssertionError: true at Test.main(Test.java:3)A assert true;B assert false;C assert false : true;D assert false == true;E assert false: false;

单选题With reference to an axial piston pump, which one of the following statements is true?()AThe cylindrical barrel is coupled to the motorBThe cylindrical barrel has an odd number of boresCThe bores end in socketsDThe sockets fit in the swash plate

多选题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 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.