问题 单项选择题

下列代码中,将引起编译错误的行是______。
(1)public class Test
(2)int m,n;
(3)public Test()
(4)public Test(int a)m=a;
(5)public static void main(String args[])
(6)Test t1,t2;
(7)intj,k;
(8)j=0;k=0;
(9)t1=new Test();
(10)t2=new Test(j,k);
(11)
(12)

A) 第3行
B) 第5行
C) 第6行
D) 第10行

答案

参考答案:D

解析: 第10行代码中的参数数目比类Test的任何一个构造方法所声明的形式参数都多,因此引起编译错误。在调用构造函数时,必须严格按照它在类中定义的形式使用,包括参数个数和数据类型等,否则将引起编译错误。

阅读理解

Hundreds of years ago, life was much harder than it is today.People didn’t have modern machines.There was no modern medicine, either.

Life today has brought new problems.One of the biggest is pollution.Water pollution has made our rivers and lakes dirty.It kills our fish and pollutes our drinking water.Noise pollution makes us talk louder and become angry more easily.Air pollution is the most serious kind of pollution.It’s bad to all living things in the world.

Cars, planes and factories all pollute our air every day.Sometimes the polluted air is so thick that it is like a quilt over a city.This kind of quilt is called smog.

Many countries are making rules to flight pollution.Factories must now clean their water before it is thrown away and they mustn’t blow dirty smoke into the air

We need to do many other things.We can put waste things in the dustbin and do not throw them on the ground,there will be less pollution.

Rules are not enough.Every person must help to fight pollution.

小题1:Hundreds of years ago.life was much harder than it is today because        

A.there were not any modern machines

B.there was no modern medicine

C.both A and B

D.there were not many people小题2:The most serious kind of pollution is         

A.noise pollution

B.air pollution

C.water pollution

D.All the above小题3:From the passage we know that       

A.a few years ago,there was no smog at all

B.today people don’t have to talk to each other in a loud voice

C.we can drink water from the polluted rivers and lakes

D.people are making rules in order to fight pollution

单项选择题