问题 填空题

写出下列程序的执行结果是【 】。  已知:’’a’’转换成整数对应的是97。  程序如下:    class Testl {      public static void main(String[] args) {  char a=’’d’’;  int b=a;  float c=a;  double d=a;   System.out.println("a="+a);   System.out.println("b="+b);   System.out.println("c="+c);   System.out.println("d="+d);  } }

答案

参考答案:a=db=100c=100.0d=100.0

解析:①char型在计算机内部是以int型存储的,所以知道“a”在计算机中对应的int型数据的值是97,那么很容易推算出“d”的对应值是100。②自动类型的转换,注意float和double型小数点后的零。

选择题
阅读理解

阅读理解。

     Started in 1636, Harvard University is the oldest of all the many colleges and universities in the United

States.Yale,Princeton,Columbia and Dartmouth were opened soon after Harvard.

     In the early years, thers schools were much alike.Only young men went to college. All the students

studied the same subjects,and everyone learned Latin, Greek and Hebrew. Little was known about

science then,and one kind of school could teach everything that was known about the world.When the

students graduated,most of them became ministers or teachers.

     In 1782, Harvard started a medical school for young men who wanted to become doctors. Later,

lawyers could receive their training in Harvard's law school.In 1825, besides Latin and Greek , Harvard

began teaching modern languages, such as French and German.Soon it began teaching American history.

     As knowledge increased. Harvard and other colleges began to teach many new subjects. Students

were allowed to choose the subjects that interested them.

     Today, there are many different kinds of colleges and universities.Most of them are made up of

smaller schools that deal with special fields of learning. There's so much to learn that one kind of school

can't offer it all.

1.The oldest university in the US is       .

A. Yale          

B. Harvard            

C. Princeton          

D. Columbia

2. From the second paragraph,we can see that in the early years,      .

A. those colleges and universities were the same

B. people,young or old,might study in the colleges

C. students studied only some languages and science

D. when the students finished their school,they became lawyers or teachers

3. Mondern languages the Harvard taught in 1825 were       .

A. Latin and Greek              

B. Latin,Greek,French and German

C. American history and German    

D. French and German

4. As knowledge increased,colleges began to teach       .

A. everything that was known     

B. law and something about medicine

C .the subjects that was known    

D. many new subjects

5. On the whole,the passage is about       .

A. how to start a university        

B. the world-famous colleges in America

C. how colleges have changed      

D. what kind of lesson each college teaches