【单选题】【消耗次数:1】
下面是有关子类继承父类构造函数的描述,其中正确的是( )。
创建子类的对象时,先调用子类自己的构造函数,然后调用父类的构造函数
子类无条件地继承父类不含参数的构造函数
子类必须通过super关键字调用父类的构造函数
子类无法继承父类的构造函数
参考答案:
复制
纠错
相关题目
【单选题】 在Java语言中,子类要想调用父类的构造方法,使用的关键字是( )
①  supe
②  this
③  extends
④  new
【单选题】 FilterOutputStream是BufferedOutputStream、DataOutputStream及PrintStream的父类,以下哪个类可能是FilterOutputStream构造函数的参数类型?
①  OutputStream
②  File
③  InputStream
④  BufferedOutputStream
【单选题】 多继承的构造顺序序可分为如下4步:①所有非虚基类的构造函数按照它们被继承的顺序构造;②所有虚基类的构造函数按照它们被继承的顺序构造;③所有内嵌对象的构造函数按照它们声明的顺序构造;④派生类自己的构造函数体;这4个步骤的正确顺序是( )
①  ④③①②
②  ②④③①
③  ②①③④
④  ③④①②
【单选题】 多继承的构造顺序序可分为如下4步:①所有非虚基类的构造函数按照它们被继承的顺序构造;②所有虚基类的构造函数按照它们被继承的顺序构造;③所有内嵌对象的构造函数按照它们声明的顺序构造;④派生类自己的构造函数体;这4个步骤的正确顺序是( )
①  ④③①②
②  ②④③①
③  ②①③④
④  ③④①②
【判断题】 面向对象的继承性是子类自动享父类数据结构和方法的机制
①  正确
②  错误
【单选题】 在创建派生类对象时,构造函数的执行顺序是()
①  对象成员构造函数―基类构造函数―派生类本身的构造函数
②  派生类本身的构造函数―基类构造函数―对象成员构造函数
③  基类构造函数―派生类本身的构造函数―对象成员构造函数
④  基类构造函数―对象成员构造函数―派生类本身的构造函数
【判断题】 Java语言中,所创建的子类都应有一个父类。
①  正确
②  错误
【单选题】 下列选项中,用于在定义子类时声明父类名的关键字是()。
①  interface
②  package
③  extends
④  class
【判断题】 构造函数用于创建类的实例对象,构造函数名应与类名相同,返回类型为void。
①  正确
②  错误
【单选题】 类的构造函数被自动调用执行的情况是在定义该类的()
①  成员函数时
②  数据成员时
③  对象时
④  友元函数时
随机题目
【单选题】 How are you _____ with your English studies?
①  getting away
②  getting together
③  getting along
④  getting up
【单选题】 I answered the question in two ways, but _____ of them was right.
①  either
②  both
③  none
④  neither
【单选题】 Ican’tmendmyshoe_____. Canyoumenditfor_____?
①  myself;me
②  myself; I
③  I
④  I; me
【单选题】 _____ people there are in a city, _____ I want to live there.
①  More; more
②  The more; the less
③  The more; the most
④  The more; the least
【单选题】 By the end of last week, we _____ all the units in this book.
①  learned
②  have learned
③  had learned
④  would have learned
【单选题】 This is the _____ mobile phone I want to buy.
①  quite
②  just
③  very
④  still
【单选题】 He was _____ his late twenties when he found his first job.
①  in
②  after
③  after
④  from
【单选题】 I _____ a few high school classmates at KFC yesterday.
①  came across
②  came along
③  came to
④  came on
【单选题】 _____ is important for us to learn how to get along with others.
①  One
②  This
③  That
④  It
【单选题】 I _____ online games when my father came back.A. played B. am playing C. have played D. was playing
①  am playing
②  played
③  have played
④  was playing