访问说明符,同时覆盖方法 [英] Access specifier while overriding methods

查看:206
本文介绍了访问说明符,同时覆盖方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设您有一个使用访问说明符public定义虚拟方法的类。
可以更改overriden方法的访问说明符吗?
我假设没有。
寻找解释。

Assume you have a class that defines virtual methods with the access specifier public. Can you change the access specifier on your overriden methods? I am assuming no. Looking for an explanation.

推荐答案

是的,但它不grok。

Yes you can, but it "doesn't grok".

请参阅 http://stackoverflow.com/questions/484592/overriding-public-virtual-functions-with-private-functions-in-c

这篇关于访问说明符,同时覆盖方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆