Packaging
is one of the three main characteristics of object-oriented
A separate entity with undivided cut
Hide the internal details
Preserving external interfaces
Authorization by Access modifier
Class is one of the most basic packages
Benefits of Encapsulation
Ensure data security
Provides a clear external interface
The internal implementation of the class can be arbitrarily modified without affecting other classes
Class is a concept
Defining classes
Class PM
{
Omit member
}
object is an entity
Creating objects
PM Pm=new pm ();
Get Set accessor guarantees field security in a class
2. Relationship between classes and objects Dept dept=new Dept ();
Parsing: A class is the type of object (big kind) code plane: Dept
An object is an instance of a class (a specific individual) the Code plane: Dept
3..NET Framework two main components: CLR (Common Language Runtime Common Language Runtime) and FCL (Framework class Library)
4. Class Library Concept: A collection of functionally similar classes.
Similar to the main program of QQ support class library, the end of the DLL file (dynamic linked library dynamically linked libraries)
Two kinds of embodiment of class library: exe DLL
5. Encapsulation: is to protect some private field security. Embodiment 2: Put the method and the field into a container (class).
6. Automatic attributes
Note: When we do not need to make a logical decision, he is equivalent to the private field + common attributes.
Automatic attribute Bottom generation: Private field + Public property
Depth. NET Framework