当前位置: 技术问答>java相关
scjp 真题一个??,?
来源: 互联网 发布时间:2015-03-17
本文导语: you want subclass in any package to have access to members of a superclass which is the most restrictive access modifier that will accomplish this objective? a.public b.protected c.private d.transient e.no access modifier is qualified 我认为选b,...
you want subclass in any package to have access to members of a superclass
which is the most restrictive access modifier that will accomplish this
objective?
a.public
b.protected
c.private
d.transient
e.no access modifier is qualified
我认为选b,大家怎么看????
which is the most restrictive access modifier that will accomplish this
objective?
a.public
b.protected
c.private
d.transient
e.no access modifier is qualified
我认为选b,大家怎么看????
|
a是肯定可以的,但根据题意的most restrictive,所以排除a,在b和e里选。
e指的是默认情形,只能在同一包内才有题中所说的权限。排除e.
选b。protected 成员对子类永远是开放的,无论该子类是否在同一包中
e指的是默认情形,只能在同一包内才有题中所说的权限。排除e.
选b。protected 成员对子类永远是开放的,无论该子类是否在同一包中
|
b
|
b
protected 成员对子类永远是开放的,无论该子类是否在同一包中
protected 成员对子类永远是开放的,无论该子类是否在同一包中