The use of destructor and namespaces in C #

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.