The use of destructor and namespaces in C #
Destructor ~
The Destructor cannot be defined in the structure. Only destructor can be used for classes.
A class can have only one destructor.
The Destructor cannot be inherited or overloaded.
You cannot call the destructor. They are automatically called.
The Destructor neither have modifiers nor parameters.
Figure 1. Run thisProgramAnd then call it.
Figure 2. Statement of destructor
Namespace (namespace), used to solve the problem of duplicate class names, can be seen as a "class folder"
Figure 3. References
You have a class and Import another class, which is rarely used in general.
Figure 4. Reference
IfCodeAnd the used class does not need using in a namespace.
There are two methods for class calling in different namespaces: (as shown in)
Write the full name namespace. Class Name
Using references the namespace before calling
Author's recentArticle:
-
- C # super-class and easy-to-use classes
-
- Thought Change
-
- The GDI + Code 2 I collected over the years
- The GDI + code I have collected over the years
-
- HTML language 3 that you cannot ignore
-
- HTML code 2 that you cannot ignore
-
- HTML language that you cannot ignore
- Our common Array
-
- Method (above) in C ):
-
- Comparison of three cycles