填空题

线程的______方法只给具有与当前线程相同优先级的线程运行的机会。

【参考答案】

yield()
<上一题 目录 下一题>
热门 试题

单项选择题
下列程序的执行结果是______。 class A1 implements Runnable { public void run() { for(iht i = 0; i < 10; i++) { System.out.println( i = + i); if(i == 3) break; } } } public class ex38 { public static void main(String[] args) { Thread th1 = new Thread(new A1()); th1.start (); } }
A.i=1 i=2 i=3 i=4
B.i=1 i=1 i=1 i=1
C.i=0 i=1 i=2 i=3
D.i=1 i=2 i=3
单项选择题
下列程序的输出结果是______。 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 运行
相关试题
  • Java的线程调度策略是一种基于优先级___...
  • 将一个对象wait poll中的一个线程移入lock...
  • Java语言中用于定义线程具体行为的方法是Th...
  • ______是指在Java程序中用synchroniz...
  • 若要获得一个线程的优先级,可以使用方法_...