So, when you fill the blank, eh, which we discuss in the polymorphism, the concrete instance should be a Person, a Cook, an Author or a Driver. Have you ever think that what if the concrete class can’t be Person? That is the concrete class should be the subclasses, not the super one.
When we discussion the overload, we said it can provide a uniform interface for the user to use the function without consider the exactly type of the parameters.
In the discussion of set and get accessor methods, I said, I left one advantage of using the set and get accessor methods to this post. Of course, I’ll show you. But, I won’t show you the answer directly. You know, show you the answer directly won’t impress you, so, let’s see some code first,
In the last part of Constructor(@see Beginning ActionScript 3.0 – Constructor), we do a simple experiment. And the experiment shows that the constructor of the superclass will also be inherited to the subclass. If you don’t call the superclass’s constructor in the subclass’s constructor, then the compile will add some code to the subclass’s constructor automatically.
We have introduced some free businese wordpress themes before (@see 61+ Free Business WordPress themes), in fact, wordpress is a very very powerful php script not only for blog, but also CMS, even photo gallery.
We collect a list of nice blog themes for wordpress designed for Photo Galleries. We hope it will save your time and be useful for all the photo bloggers out there. Enjoy!
When we introduce the basic OOP concepts, we use an example to illustrate the OOP-style code(@see Beginning ActionScript 3.0 – Introduction to OOP). Inside the example, we use the new operator. Did you still remember the function of “new” operator?
If you don’t use the keyword “private” to modify the properties, then you can use the properties in the subclass in most cases. That’s the conclusion we ade in last section. Now, we’re going to talk about the exception situation.
From previou post Beginning ActionScript 3.0 – Inheritance, we have know that a key advantage of inheritance is that it allows you to reuse code from a base class yet leave the existing code unmodified. For example, you can build a new subclass Cook to extend from the class Person, and then the class Cook can have the method “haveBreakfast” automatically.