C # Self-study summary _day2

Source: Internet
Author: User

Object-oriented concepts:

1. Further encapsulation of objects with the same attributes and methods, the concept of abstraction, is the mold that determines the properties and methods that an object should have.

2. Objects are created from the class (an instance of the object can be called Class).

3. Write a class that creates an object for the class and instantiates the class. Syntax: class instance name =new Class ();

4. Properties: Protect the field and qualify the field assignment and value. (Get and set, see Supplemental)

5. Inheritance: A class derives multiple classes or interfaces for the initialization of the parent class, C # cannot directly implement multiple inheritance, through the interface implementation, the keyword interface. (There are various ways to inherit, add later)

6. Polymorphism: One interface multiple functions, divided into static polymorphism and dynamic polymorphism. Static polymorphism mainly has function overloading and operator overloading. Dynamic polymorphism is mainly abstract to create an abstraction class, put sealed in front of the class as the encapsulation class. (This is not very understanding, write small topic after understanding)

Detailed knowledge:

7. Class default internal (limited access within the same assembly)

8.new overwrite, does not change the parent class method function; Override, override, change the parent method function. Virtual implements the method, and can be overridden by the quilt class; abstract no implementation method, must be overridden, cannot create an instance, can only inherit.

9. After the destructor----The program finishes, the destructor executes; C # has its own GC (garbage collection).

10.out and Ref:ref (there are in-out), parameter values are passed into the function, pass the ref parameter must be initialized first; out (only): Empty the parameter value, must be initialized once.

C # Self-study summary _day2

Related Article

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.