1.Class visibility has public and internal two, public is visible to all assemblies, and internal is visible only to the assembly in which it resides. The default is public.
2. Friend assembly,
Using friend assembly, you can implement unit testing without using reflection technology.
The book is about compiling according to the command line.
I tested it with the VS2005 solution, as follows:
3. Accessibility of Members
Members are private by default, and members of the interface type are public.
When a subclass overrides a member of the parent class, the original member has the same accessibility--c# as the overriding member; the CLR's constraint is that the overriding member's accessibility cannot be lower.
The CLR and C # are not the same, such as tables:
CLR terminology |
C # Terminology |
Private |
Private |
Family |
Protected |
Family and Assembly |
does not support |
Assembly |
Internal |
Family or Assembly |
protected internal |
Public |
Public |
4. Static Class
Static can only be used for class and cannot be used for struct because the CLR requires that the value be instantiated and cannot control the instantiation process.
C # constraints on static classes:
Static classes must derive directly from System.Object
Static classes cannot implement any interfaces
Static classes can only define static members: Fields, methods, properties, events
Static classes cannot be used as: fields, methods, arguments, local variables.
In MSIL, ctor is not generated for static classes, which are marked as abstract and sealed