Thread类的sleep方法会抛出()异常。
A.IOException
B.InterruptedException
C.EOFException
D.SecurityException
第1题:
A.Thread.wait();
B.Thread.join();
C.Thread.yield();
D.Thread.sleep(1);
E.Thread.notify();
第2题:
A.yield()
B.sleep(longmsec)
C.go()
D.stop()
第3题:
下列方法中,声明抛出InterruptedException类型异常的方法是
A.suspended()
B.resume()
C.sleep()
D.start()
第4题:
下列程序的功能是在监控台上每隔-秒钟显示-个字符串”Hello!¨,能够填写在程序中下画线位置,使程序完整并能正确运行的语句是( )。
A.sleep(1000)
B.t. sleep(1000) InterruptedExceptionInterruptedException
C.Thread. sleep(1000)
D.Thread. sleep(1000) RuntimeExceptionlnterruptedException
第5题:
判断下列语句哪个正确()。
第6题:
下面哪个不是Thread类的方法?()
第7题:
下面方法不属于Thread类里面的是()
第8题:
下面()让线程休眠1分钟。
第9题:
Thread.Sleep(30000)
Thread.SpinWait(30000)
Thread.QueueUserWorkItem(30000)
Thread.SpinWait(30)
第10题:
It is possible to synchronize static methods.
When a thread has yielded as a result of yield(), it releases its locks.
When a thread is sleeping as a result of sleep(), it releases its locks.
The Object.wait() method can be invoked only from a synchronized context.
The Thread.sleep() method can be invoked only from a synchronized context.
When the thread scheduler receives a notify() request, and notifies a thread, that thread immediately releases its lock.
第11题:
Thread.sleep(1);
Thread.sleep(100);
Thread.sleep(1000);
try{ Thread.sleep(1); ) catch (Exception e) { }
try{Thread.sleep(100); ) catch (Exception e) { }
try{Thread.sleep(1000); ) catch (Exception e) { }
第12题:
PropertyException
PropertyVetoException
VetoException
PropertyChangeException
第13题:
A.run
B.join
C.sleep
D.start
第14题:
5.classOrder2implementsRunnable{6.publicvoidrun(){7.for(intx=0;x〈4;x++){8.try{Thread.sleep(100);}catch(Exceptione){}9.System.out.print("r");10.}}11.publicstaticvoidmain(String[]args){12.Threadt=newThread(newOrder2());13.t.start();14.for(intx=0;x〈4;x++){15.//insertcodehere16.System.out.print("m");17.}}}哪一个插入到第15行,最有可能产生输出rmrmrmrm?()
A.Thread.sleep(1);
B.Thread.sleep(100);
C.Thread.sleep(1000);
D.try{Thread.sleep(100);}catch(Exceptione){}
第15题:
以下不属于Thread类提供的线程控制方法的是( )。
A.bmak()
B.sleep()
C.yield()
D.join()
第16题:
下列方法可以通过Thread类就可以调用,而不需要通过Thread类的实例进行调用的是 ( )
A.sleep()
B.start()
C.setPriority()
D.suspend()
第17题:
下列哪些方法是Thread 类中所定义的方法?()
第18题:
下面关于Java中线程的说法不正确的是()
第19题:
现有: class Thread2 implements Runnable { void run() { System.out.print("go "); } public static void main(String [] args) { Thread2 t2 = new Thread2(); Thread t = new Thread(t2); t.start(); } } 结果为:()
第20题:
5. class Order2 implements Runnable { 6. public void run() { 7. for(int x = 0; x 〈 4; x++) { 8. try { Thread.sleep(100); } catch (Exception e) { } 9. System.out.print("r"); 10. } } 11. public static void main(String [] args) { 12. Thread t = new Thread(new Order2()); 13. t.start(); 14. for(int x = 0; x 〈 4; x++) { 15. // insert code here 16. System.out.print("m"); 17. } } } 哪一个插入到第15行,最有可能产生输出 rmrmrmrm ?()
第21题:
run
join
sleep
start
第22题:
在线程休眠时,sleep方法会占用处理器时间
将方法声明为synchronized,就可以确保不会发生死锁
不提倡使用Thread类的suspend方法,resume方法和stop方法
以上描述都正确
第23题:
调用join()方法可能抛出异常InterruptedException。
sleep()方法是Thread类的静态方法。
调用Thread类的sleep()方法可终止一个线程对象。
线程启动后执行的代码放在其run方法中。
第24题:
go
编译失败
代码运行,无输出结果
运行时异常被抛出