niusouti.com

已知Student类是一个空类,stu1和stu2是Student类的两个对象,则通过“stu1.name='李晓明'”语句增加的属性可以通过()访问。A.Student.name、stu1.name或stu2.nameB.Student.name或stu1.nameC.stu1.name或stu2.nameD.stu1.name

题目
已知Student类是一个空类,stu1和stu2是Student类的两个对象,则通过“stu1.name='李晓明'”语句增加的属性可以通过()访问。

A.Student.name、stu1.name或stu2.name

B.Student.name或stu1.name

C.stu1.name或stu2.name

D.stu1.name


相似考题
参考答案和解析
参考答案:D
更多“已知Student类是一个空类,stu1和stu2是Student类的两个对象,则通过“stu1.name='李晓明'”语句增加的属性可以通过()访问。 ”相关问题
  • 第1题:

    12、已知Student类是一个空类,则通过“Student.name='unknown'”语句增加的属性可以通过()访问。

    A.类名或对象名

    B.仅类名

    C.仅对象名

    D.无法访问


    Student s1 = p1.newInstance();

  • 第2题:

    已知Student类有一个属性__id,stu是Student类的对象,则通过“stu.__id='1810101'”可以将stu对象中的__id属性赋值为字符串'1810101'。


    错误

  • 第3题:

    2、已知Student类有一个属性__id,stu是Student类的对象,则通过“stu.__id='1810101'”可以将stu对象中的__id属性赋值为字符串'1810101'。


    错误

  • 第4题:

    已知Student类是一个空类,则通过“Student.name='unknown'”语句增加的属性可以通过()访问。

    A.类名或对象名

    B.仅类名

    C.仅对象名

    D.无法访问


    A

  • 第5题:

    有student类,类中声明了公有静态数据成员id,建立student类的对象stu1,则关于数据成员id的访问,下列表达式正确的是:

    A.student::id

    B.stu1.id

    C.stu1::id

    D.student.id


    Student(int x){…}