Obiective-C implemented in "multi-state" the same name but different classes. The ability to make different classes share the same method name.
/ * For chestnut:
Fraction class has a print method
Complex class has a print method
They have the same print method, but they are a different class
This is called polymorphism
CAO! Is this to understand?
* /
TMD I really wanted to make sure that I got it wrong, or really so?
From other programming languages, polymorphism generally refers to:
of the same class, the same way a number of names, but their signature is different.
When this method is invoked, it will automatically match the different ways according to the method parameters.
This is called polymorphism.
WTH? but ..... OBJ-C of this so-called multi-state, only refers to the different classes, but they can use the same method name respectively.
That what is called polymorphism, polymorphic completely pointless!
Reply:
You should understand the concept is wrong, for the above phrase, in other programming languages, it is not called "polymorphic" should be called "overloaded method"
If asked, "reload", then I can tell you, there is no method in objective-c of "overloading"
Talk about the concept of "multi-state". Polymorphism is reflected in the class inheritance means multiple subclasses inherit the same parent. The identity of the parent class needs to occur in some cases subclasses. For example, in some design mode, you need to dynamically at runtime to instantiate a class, but the class code, we do not know which class is the final instance, when we need to use the parent class to placeholder. In this case we call polymorphism.
Reply:
You do not know where to see examples. Polymorphism is with language-independent.
Reply:
Please differentiate between overloaded (overload) and coverage (override).
Reply:
If English is recommended that you see a good point talking about Apple's developer site at objc2.0 domestic translated it there is such a thing eludes many concepts .....
No comments:
Post a Comment