c#中的访问说明符 [英] access specifier in c#

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

问题描述

在C#中将私有访问说明符放在类前面会发生什么?

what happens putting a private access specifier in front of class in C#?

推荐答案

C#中没有私有类但你可以使用关键字internal, class只在它所构成的程序集中可见(dll)。



但是如果它在另一个类(嵌套类)中声明,你可以将它设为私有
there is no private class in C# but you can use keyword internal, making the class visible only in the assembly it constains(dll).

but you can make a class private if it is declared inside another class (nested class)


它不允许我们将参数发送到下一页
it won''t allow us to send parameters to next page


据我所知,C#不允许创建私有类。



如果您需要更多信息,可以参考

http://stackoverflow.com/questions/3574404/can-you-create-private-classes-in-c [ ^ ]
Hi as per My knowledge C# doesn''t allow to create private class.

if u need much more info on this you can refer
http://stackoverflow.com/questions/3574404/can-you-create-private-classes-in-c[^]


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

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