C # Interfaces and arrays

Source: Internet
Author: User

1. Because C # can only inherit a class, to achieve the inheritance of different classes of attributes, you must use the interface (interface), the interface inside the method is public, but no concrete implementation;

2. When an interface is inherited, all methods of the interface must be implemented;

3. When multiple excuses are inherited and the method has the same name, you must explicitly define the second method with the same name, which is public by default, and you need to upcast the instance when calling an explicitly defined method.

4. The member data of the interface can be hidden by the property, and the get and set can manipulate it;

5. C # can create an array briefly, but if it is not recognized it needs a complement type, and the keyword params can not explicitly create an array pass-through parameter

6. C # supports creating irregular arrays

After this week's study, I feel C # and C + + many similarities.

C # Interfaces and arrays

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.