问题
单项选择题
使用下列哪个选项可以调用基类中的特定构造方法
A.final
B.this
C.super
D.static
答案
参考答案:C
解析:super用来引用当前对象的父类。当子类隐藏了父类的变量,并重 写了父类的方法后,又要使用父类变量或父类被重写的方法时,可通过super来实现对父 类变量的访问和对父类方法的调用。this用来引用当前的对象。
使用下列哪个选项可以调用基类中的特定构造方法
A.final
B.this
C.super
D.static
参考答案:C
解析:super用来引用当前对象的父类。当子类隐藏了父类的变量,并重 写了父类的方法后,又要使用父类变量或父类被重写的方法时,可通过super来实现对父 类变量的访问和对父类方法的调用。this用来引用当前的对象。
阅读下面的短文,从所给单词中选出适当的单词,并且用其正确的语言形式填在标有题号的空白处,使句意通顺完整。(每空一词,每个单词使用一次)
To 小题9: money, some people thought of the idea of “car sharing”. If we share a car, we can only pay for it 小题10: we use it. Now more and more people would 小题11: to do car sharing. In Switzerland(瑞士), about 40,000 people are 小题12: this thing. Japan is 小题13: trying to make “car sharing” popular around the country. “Car sharing” is a new idea in transportation(交通). It is also very easy 小题14: us to go everywhere we want without 小题15: a car. |