问题 单项选择题

下面不属于类的构造方法具备的特点是( )。

A.没有返回值

B.用户可以通过new自动调用。

C.构造方法名必须和类名相同

D.用户可以直接调用

答案

参考答案:D

解析: 构造方法是类中的一种特殊方法,是为对象初始化操作编写的方法,用它来定义对象的初始状态。在Java语言中的每个类都有构造方法,它也是由方法名、参数和方法体组成。构造方法名必须与类名相同,它没有返回值,用户不能直接调用它,只能通过new自动调用。

完形填空
完型填空
        Many children have birthday cakes on their birthdays. In some ___1___, like England and Scotland, there is another custom, too. People beat or hit the___2___on his/her birthday. This may hurt___3___, but they say it is very lucky for the child. The child must ___4___cry. The custom says, if you ___5___, you will cry all year. They say the birthday spanks (一巴掌) is to make the bad spirits(邪气) ___6___. The harder you spank the better. In Belgium, another country in Europe, the custom is a little __7___. There a parent goes into the child's room ___8___in the morning with a needle. As soon as the child ___9___ up, the parent pricks(刺) the child with the needle. This is for good __10____.
( )1. A. countries  
( )2. A. children    
( )3. A. a few      
( )4. A. never      
( )5. A. laugh      
( )6. A. out        
( )7. A. difficult  
( )8. A. late        
( )9. A. wakes      
( )10.A. sleep      

B. cities      
B. girl        
B. a little    
B. ever        
B. sleep        
B. along        
B. different    
B. quickly      
B. runs        
B. luck        

C. towns        
C. child        
C. a lot        
C. /            
C. speak        
C. about        
C. helpful      
C. early        
C. stands      
C. birthday    

D. villages            
D. boy                
D. much                
D. always              
D. cry                
D. away                
D. friendly            
D. slowly              
D. comes              
D. breakfast          

简答题