【单选题】【消耗次数:1】
关于内部类,下列说法不正确的是( )
内部类不能有自己的成员方法和成员变量
内部类可用 private 或 protected 修饰符修饰
内部类可以作为其他类的成员,而且可访问它所在的类的成员
除 static 内部类外,不能在类内声明 static 成员
参考答案:
复制
纠错
相关题目
【单选题】 下列哪种类成员修饰符修饰的变量只能在本类中被访问?( )
①  protected
②  public
③  default
④  private
【单选题】 声明成员变量时,如果不使用任何访问控制符(public, protected, private),则以下哪种类型的类不能对该成员进行直接访问 ( )
①  同一类
②  同一包中的子类
③  同一包中的非子类
④  不同包中的子类
【单选题】 关于被私有访问控制符private修饰的成员变量,以下说法正确的是( )
①  可以被三种类所引用:该类自身、与它在同一个包中的其他类、在其他包中的该类的子类
②  可以被两种类访问和引用:该类本身、该类的所有子类
③  只能被该类自身所访问和修改
④  只能被同一个包中的类访问
【单选题】 定义外部类的类头时,不可用的关键字是( ) 。
①  public
②  final
③  protected
④  abstract
【单选题】 不允许作为类及类成员的访问控制符的是( )。
①  public
②  private
③  static
④  protected
【单选题】 在哪种派生方式中,派生类可以访问基类中的protected成员( )
①  public和private
②  public和protected
③  protected和private
④  仅protected
【单选题】 在哪种派生方式中,派生类可以访问基类中的protected成员( )
①  public和private
②  public和protected
③  protected和private
④  仅protected
【判断题】 子类的成员变量和成员方法的数目一定大于等于父类的成员变量和成员方法的数目。
①  正确
②  错误
【单选题】 若classB中定义了一个classA的类成员Aa,则关于类成员的正确描述是()
①  在类B的成员函数中可以访问A类的私有数据成员
②  在类B的成员函数中可以访问A类的保护数据成员
③  类B的构造函数可以调用类A的构造函数做数据成员初始化
④  类A的构造函数可以调用类B的构造函数做数据成员初始化
【单选题】 定义外部类时不能用到的关键字是( )
①  final
②  public
③  protected
④  abstract
随机题目
【单选题】 Mr. Milton prefers to resign ____ part in such dishonest business deals.
①  than take
②  than to take
③  rather than take
④  rather than to take
【单选题】 We went on a(n) ____ to the mountain yesterday.
①  excursion
②  trip
③  tour
④  travel
【单选题】 If your new coat is too large, a tailor can____ it to fit you.
①  alter
②  transform
③  vary
④  change
【单选题】 Many automobile accidents were ____ careless driving.
①  attributed to
②  resulted in
③  contributed to
④  raised from
【单选题】 To obtain a satisfactory result, one must apply two ____ of paint on a clean surface.
①  coats
②  levels
③  times
④  courses
【单选题】 No one would have time to read or listen to an account of everything ____going on in the world.
①  it is
②  as is
③  there is
④  what is
【单选题】 They have done things they ought_____.
①  not to do
②  not to be done
③  not to have done
④  not having done
【单选题】 ____ native to North America, corn has now spread all over the world.
①  In spite of
②  That it is
③  It was
④  Although
【单选题】 Bit by bit, a child makes the necessary changes to make his language ____.
①  as other people
②  as other people’s
③  like other people
④  like other people’s
【单选题】 Please____ me whether I should accept the offer.
①  advise
②  suggest
③  propose
④  direct