1、public:public表明该数据成员、成员函数是对所有用户开放的,所有用户都可以直接进行调用。
2、private:private表示私有,私有的意思就是除了class自己之外,任何人都不可以直接使用。
3、protected:protected对于子女、朋友来说,就是public的,可以自由使用,没有任何限制,而对于其他的外部class,protected就变成private。
扩展资料:
三种类型的继承,父类的成员均被子类继承(之前的百科关于这点的描述是错误的),只是由类实例化的对象对其继承的成员的访问权限会有所变化。三种不同方式的继承,描述的是子类实例化对象对其成员的访问权限,并非是描述子类时,子类对继承自父类的成员的访问权限。
公有继承 继承自父类的成员保持不变。
私有继承 继承自父类的成员全部变为私有成员。
保护继承 继承自父类的公有成员变为保护成员,其余不变。
参考资料:类百度百科
protected的意思是:保护。
一、释义
vt.保护;保卫;(protect的过去式和过去分词)。adj.受保护的。网络释义:保护;受保护的;受保护;保护的。
二、造句
1、He is a deeply nauseated man from whom society needs to be protected.他是一个极不健全的人,社会需要对他有所防备。
2、Any person who is seized of land has a protected interest in that land.拥有土地终身保有权的人都享有对那土地的产权并受到保护。
3、Logging is continuing in protected areas in violation of an international agreement.树木采伐在保护区继续泛滥,违反了国际公约。
4、She prickled at the implication that she had led a soft and protected life.有人暗指她生活舒适受宠,她很生气。
v. 保护;投保
读音:英[prə'tekt]、美[prə'tekt] 。
副词:protectingly。
过去式:protected
过去分词:protected
举例:He raised his arm to protect his child from 。
hurt.
他伸出手去,保护他的孩子免受伤害。
用法
1、protect的基本意思是“保护,保卫”,即保护某人或某物不受伤害或破坏,还可指以征收进口税“保护”国内工业。
2、protect是及物动词,接名词或代词作宾语,可用于被动结构,也可接介词against〔from〕引起的短语充当补足语的复合宾语。
3、表示“保护……不使受到……的损害或侵犯”时常用结构protect...against/from...来表示,但较大的事件如天灾多用against,小事件如冷气则用from。
protected读法:英[prəˈtektɪd]、美[prəˈtektɪd]。
vt.保护;保卫;(protect的过去式和过去分词)。
adj.受保护的。
网络释义:
1、保护。模型的几何、拓扑以及实现其它功能。在应用中,可直接通过类的公共(public)数据成员和保护( protected) 数据成员以及成员函数( member functi oh) 与ACIS相互作用。
2、受保护的。问权限,定义对象时可以在前面添加修饰符.修饰符有五种:private(私有的),protected(受保护的),internal(程序集内部的),public(公开的),以及...Java栈与堆。
3、受保护。中的其他类相当于公开(public),对于不是同一个包中的其他类相当于私有(private)。受保护(protected)对子类相当于公开,对不是同一包中的没有父子关系的类相当于私有。
4、保护的。是:公有的(bli)l公有的(public)、私有的(private)、和保护的(protected)。在模型图上,公有可见性用加号表示(+),私有可见性用减号(-)表示,保护可见性用井字。
双语例句:
1、He is a deeply nauseated man from whom society needs to be protected.。
他是一个极不健全的人,社会需要对他有所防备。
2、Any person who is seized of land has a protected interest in that land.。
拥有土地终身保有权的人都享有对那土地的产权并受到保护。
3、Logging is continuing in protected areas in violation of an international agreement.。
树木采伐在保护区继续泛滥,违反了国际公约。
4、She prickled at the implication that she had led a soft and protected life.。
有人暗指她生活舒适受宠,她很生气。
5、We need a shorter workweek and protectedbenefits for contract workers.。
我们必须使合同工享有更短的周工作时间和有保障的利益。
6、[as noun strip-mining]protected lands opened up to strip-mining for coal.。
辟为露天采煤的保护地。
7、In the event of your death,your family will be protected against any financial problems that may arise.。
如果你身故,你家人会有保障,免于可能产生的任何经济问题。
8、Our political unity needs to be protected and nursed.。
我们必须悉心维护政治上的团结一致。
9、Recently vaccinated calves should be protectedfrom challenge.。
刚接种疫苗的小牛需加保护,使其免疫系统不与病原体接触。
10、Her strength comforted and protected me.。
她的坚强保护着我,使我不再紧张。
protected[英][prə'tektɪd] [美][prə'tektɪd] 。
生词本
简明释义
v.保护( protect的过去式和过去分词 );防护;投保;关税保护。
以下结果由 金山词霸 提供
柯林斯高阶英汉词典
网络释义
百科释义
1.ADJ受保护的Protected is used to describe animals, plants, and areas of land which the law does not allow to be destroyed, harmed, or damaged.。
In England, thrushes are a protected species so you will not find them on any menu.。
在英格兰,歌鸫是受保护物种,因此你在任何菜单上都找不到。
...a protected zone of national forest.。
国家森林保护区
以下结果由 金山词霸 提供
例句
Office buildings and public places are all well protected.。
政府大楼和公共场所受到很好的保护。
article.yeeyan.org。
Mr livingstone has proposed adding 16 city vistas to the ten protected today.。
伦敦市长livingstone先生已经提议给现在受保护的10个城市景观增加到16个。
www.ecocn.org
Many security buildings in the centre of the capital are already cordoned off and protected by concrete barriers andsandbags.。
首都中心的许多安全机构建筑已经拉起警戒线并用混凝土路障和沙包构筑了防护屏障。
www.ecocn.org
At least, they were protected then.。
那个时候她们至少还受到保护。
article.yeeyan.org。
Is your family protected from financial crisis?。
你的家庭是否做好了应对经济危机的保护措施?