[Oc learning notes] convenience constructor cannot be inherited, oc learning notes

Source: Internet
Author: User

[Oc learning notes] convenience constructor cannot be inherited, oc learning notes

Today, my teacher talked about the convenience constructor and inheritance, so I was wondering if the convenience constructor can inherit from the quilt class just like the methods in the parent class?

The answer is of course no. First, the parent class constructor is written to create a parent class object, just as your grandfather and your grandmother are the parent class constructor, the parent class object of your father is generated;

However, your father and your mother are sub-class constructor, which generates your sub-class object;

If the constructor can inherit, you can use the parent class constructor, your grandfather and your grandmother;

So when I think of this, the idea is suddenly open.

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.