问题 单项选择题

执行下面程序后输出的正确结果是
public class Test
public stoic void main (String args[])
byte x=3, y=4;
long r=80L;
System.out.print(r/y);
System.out.print(",");
System.out.print(x/y);

A.20.0, 1

B.20.0, 1.0

C.20,0

D.20, 1.0

答案

参考答案:C

解析: 本题考查Java语言的二元运算符的使用。Java中的二元运算符适用于所有数值型数据类型,包括整型和浮点型。但考生需要注意,如果两个操作数全为整型,那么,只要其中一个为long型,则表达式结果为long型:其他情况下,即使两个操作数全是byte或short型,表达式结果也是int型;如果操作数为浮点型,那么只要其中一个为double型,表达式结果就是double型;只有两个操作数全是float型或其中一个是float型而另外一个是整型时,表达式结果是float型。所以选项C为正确答案。考生如果理解了L的含义,就能很容易回答。考生务必注意操作数类型不同时,运算结果的类型,同时注意当“/”和“%”运算中除数为。时会产生异常。

完形填空
完形填空。
     I know my brother better than anyone else in the world. Since the moment of his birth, I've been part of
his life. I had spent seven  1  years in the world with the attention of those around me. But when Rohan was
born, life  2  Suddenly I had to  3  my toys and there were no more bedtime stories or my own choice of food.
     Finally, I felt my  4  at my brother. The poor baby had no idea what had made me so unhappy. Maybe he
found me strange, the only person in this house  5  did not like him. Whatever the reason was, he loved  6  me
around. However, I seldom talked to him and  7  asked him to leave me alone.
     Then all that changed. I hardly remember everything of that day six years ago,  8  I do remember that I
was feeling very angry. Somehow my feet led me to my brother's bed. My hand, completely  9  from my mind,
reached through the bars (护栏). At once, he reached his small hand and softly touched  10  And that was all
I needed. Through all the unhappiness of the day, that one moment changed  11  How could I hate someone
who made me feel so important? For the   12  time, I saw my brother, not through the eyes of a child who
was no longer favored (宠爱), but through the eyes of a  13  
     To this day, I can't imagine life  14  my brother. It is unbelievable how much I have  15  about life from a
seven-year-old boy. Above all, Rohan has taught me that one should not care only for himself.
( )1. A. happy   
( )2. A. began   
( )3. A. collect 
( )4. A. fun     
( )5. A. which   
( )6. A. showing 
( )7. A. always  
( )8. A. but     
( )9. A. far     
( )10. A. one    
( )11. A. nothing
( )12. A. first  
( )13. A. student
( )14. A. except 
( )15. A. cared  
B. hard      
B. continued 
B. choose    
B. anger     
B. where     
B. carrying  
B. already   
B. so        
B. sick      
B. both      
B. everything
B. second    
B. parent    
B. besides   
B. learned   
C. lonely   
C. changed  
C. hide     
C. fear     
C. who      
C. meeting  
C. hardly   
C. or       
C. different
C. mine     
C. something
C. last     
C. teacher  
C. without  
C. talked   
D. busy      
D. saved     
D. share     
D. worry     
D. what      
D. following  
D. almost    
D. for        
D. free     
D. them       
D. anything  
D. next                      
D. sister    
D. through   
D. heard     
选择题