已知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


相关考题:

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

已知stu1和stu2是Student类的两个对象,则执行“stu1stu2”时会自动执行Student类的方法。() A、__gt__B、__ge__C、__lt__D、__le__

已知stu1和stu2是Student类的两个对象,则执行“stu1>stu2”时会自动执行Student类的()方法。 A.__lt__B.__le__C.__gt__D.__ge__

已知stu1和stu2是Student类的两个对象,则执行“stu1>stu2”时会自动执行Student类的()方法。A.__gt__B.__ge__C.__lt__D.__le__

12、已知Student类是一个空类,则通过“Student.name='unknown'”语句增加的属性可以通过()访问。A.类名或对象名B.仅类名C.仅对象名D.无法访问

已知Student类是一个空类,则通过“Student.name='unknown'”语句增加的属性可以通过()访问。A.类名或对象名B.仅类名C.仅对象名D.无法访问

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

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

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