"Object-c" inheritance, super keyword

Source: Internet
Author: User

Tagged with: Object object C class-oriented inheritance

Multiple inheritance is not supported in Point:1, Oc. Dynamic invocation. 2. The data members of a derived class cannot have the same name as the base class, and if the name is the same, the system will not define success 3, the member function of the base class can be the same as the name of the base class member function (equivalent to the virtual function in C + +) 4, in the derived class to call the method in the base class 5, Object-c has the characteristics of single inheritance, each subclass has only one direct parent Class 6, subclasses can inherit to all member methods of the parent class and all member variables 7, most of the time the subclass is always based on the parent class, extending the new method and variable 8, Subclasses containing a phenomenon with the same name as a parent class are called method overrides or method overrides (override), and you must note that the method name and label name must be identical when overridden.
The Load method (class method) is not called and is called automatically by the system. Call Order: base class, derived class, classification method Initialize method (class method) class instantiation The first call is used
The Super keyword is used to qualify the object to invoke the property or method it inherits from the parent class, and as self, super cannot appear in the class method. Callers in a class method can only be the class itself, not the object. The program enforces the use of the Super keyword to specify a data member or method member that invokes the parent class, and can access the member variables that are hidden in the parent class.

"Object-c" inheritance, super keyword

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.