问题 填空题

下列程序的功能是创建一个显示5个“Hello!”的线程并启动运行,试将程序补充完整。public class ThreadTest extends Thread{ public static void main(String args[ ]){ThreadTest t=new______;t.start( );} public void run( ){int i=0;while(true){System.out.println("Hello!");if(i++==4)break; }}

答案

参考答案:ThreadTest( )

解析:

[分析]: ThreadTest继承自java.lang.Thread类,重写了run( )方法,实现了Java中的线程。ThreadTest t定义了空的线程对象,t.start( )方法启动了这个线程,因此ThreadTest t=new ______;就应该是实例化此线程对象,所以应填入“ThreadTest( )”。

选择题
填空题

Part 4


Questions 26-45


·Read the following passage and decide which answer best fits each space.
·For questions 26-45, mark one letter A, B, C or D on the Answer Sheet.
Participation (26) high school sports is not a constitutional right. (27) , it is a privilege, paid for by taxpayers, open to students who promise to (28) certain conduct requirements on and off the field. One of these promises is to (29) from using drugs. Drug use is a serious problem among high school students. Studies show that as many as 500, 000 high school students use muscle-pumping, life-destroying substances such as steroids. Many more use illegal drugs, (30) cause discipline problems and (31) the stage for lifelong (32) .
Drug testing works to (33) and identify use. That is why drug testing is required to compete in the Olympics, the National Collegiate Athletic Association and the National Football League. (34) drug testing was instituted by these organizations, use of performance- (35) drugs has been greatly reduced. We should want (36) in schools.
Indeed, many athletes (37) testing programs, and no wonder. Without testing, athletes have to choose between drug use and a competitive disadvantage (38) the field.
Those who challenge the need for drug testing may be forgetting (39) it is like be an adolescent. Peer pressure is enormous, and one of the few effective counter-weights is the fear of being caught. More importantly, once drug use is (40) , a school can (41) to the student before he or she gets addicted or arrested.
For 25 years, public schools (42) by federal judges and civil libertarians, with results everyone can see. It is time (43) decisions on how to run public schools locally (44) officials. There is nothing unconstitutional about asking those who gain the advantages of school-sponsored athletics to contribute to the safety of other players, the integrity of the game and their own well-being. The Supreme Court should leave these programs (45) .

A.release

B.relieve

C.refrain

D.protect