首页 > 学院 > 开发设计 > 正文

【转载】#303

2019-11-17 03:18:40
字体:
来源:转载
供稿:网友

【转载】#303 - accessibility of Class Members

Members of a class can have different kinds of accessibility.An accessibility keyWord indicates what source code can access the member. The different types of accessibility are:

  • public -All code can access the member
  • PRivate -Only other code in the class can access the member
  • protected -Code in this class or any class that inherits from this class can access
  • internal -Code in files in the same assembly (.dll or .exe) can access
  • protected internal -Code in the same assembly or in classes that inherit from this class can access

Accessibility keywords can apply to the following kinds of members of a class: fields, properties, methods, constants, indexers, events, constructors and nested types. They can apply to both instance and static members.

原文地址:#303 - Accessibility of Class Members


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表