国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

C#中默認的修飾符

2019-11-17 02:24:37
字體:
來源:轉載
供稿:網友

C#中默認的修飾符

參考自Default visibility for C# classes and members (fields, methods, etc)?

Classes and structs that are declared directly within a namespace (in other Words, that are not nested within other classes or structs) can be either public or internal. Internal is the default if no access modifier is specified.

直接聲明在命名空間下的類和結構體,默認是internal的。

The access level for class members and struct members, including nested classes and structs, is PRivate by default.

類和結構體的成員,包括內嵌的類和結構體,默認是private的

interfaces default to internal access.

接口默認是internal的

Delegates behave like classes and structs. By default, they have internal access when declared directly within a namespace, and private access when nested.

委托和類以及結構體類似。直接聲明在命名空間下的訪問權限默認是internal的。如果內嵌的話,就是private的。

Top-level types, which are not nested in other types, can only have internal or public accessibility. The default accessibility for these types is internal.

總結,最高等級的類型(沒有內嵌在其他類型中),只能有internal和public的訪問權限。這些類型默認的訪問權限是internal

然而對于內嵌的類型來說And for nested types:Members of Default member accessibility---------- ----------------------------enum public //enum的成員是public的訪問權限class private //類的成員,默認是private的訪問權限interface public //接口的成員,默認是public的訪問權限struct private //結構體的成員,和class類似,默認的訪問權限也是private的


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 乌海市| 鄱阳县| 天镇县| 泰和县| 霸州市| 建始县| 晋州市| 武穴市| 滦平县| 天门市| 兴山县| 察雅县| 中阳县| 柳河县| 瑞金市| 竹山县| 英山县| 荥阳市| 清新县| 祁阳县| 盱眙县| 木里| 攀枝花市| 兰西县| 丘北县| 和龙市| 唐山市| 罗江县| 灵寿县| 尚义县| 沙雅县| 伊金霍洛旗| 龙江县| 全南县| 吴桥县| 永福县| 阿克| 苏州市| 左贡县| 乐亭县| 灵石县|