zoukankan      html  css  js  c++  java
  • c# 的访问修饰符是private 还是 internal?

    准确的说,不能一概而论。


    [MSDN]
    Classes and structs that are not nested within other classes or structs can be either public or internal. A type deleted as public is accessible by any other type. A type deleted as internal is only accessible by types within the same assembly. Classes and structs are deleted as internal by default unless the keyword public is added to the class definition, as in the previous example. Class or struct definitions can add the internal keyword to make their access level explicit. Access modifiers do not affect the class or struct itself — it always has access to itself and all of its own members.


    类(class)或结构(struct)如果不是在其它类或结构中的话,它的访问类型要不就是internal, 要不就是public;
    换句话说,如果它在其它类或结构中的话,则可以为private 或protected等。下面我说的类和结构,如无特殊说明,均指非"类中类"
    类或结构的默认访问类型是internal.
    类中所有的成员,默认均为private。

  • 相关阅读:
    PHP生成pdf文档
    PHP将数据库数据批量生成word文档
    三个常用的PHP图表类库
    Javascript——(1)
    python学习HTML之CSS(2)
    python学习HTML之CSS
    python学习之HTML
    python学习之rabbitmq
    第10周15/16/17
    多进程
  • 原文地址:https://www.cnblogs.com/baoconghui/p/2018969.html
Copyright © 2011-2022 走看看