variety of methods. This means that for a group of related actions design a generic interface. Polymorphism allows the same interface,, thus reducing the complexity of the program will be in the same class action. Specific actions (specific action) () used in each case is the task of the compiler,, programmers do not need to manually choose. You only need to remember and use a common interface to retake the dog as a metaphor,, a dog's sense of smell is polymorphic. If the dog smell the smell of the cat,, it will bark and run after it. If the dog smell the smell of the food,, it will secrete saliva ran to the large food bowl. The two situations at work,, the difference lies in the same olfactory organ smelled the odor,, that is,, there are two different types of data acting on the dog's nose! Use a Java program,, this general concept can be used if appropriate,, in the programming environment composed
Related articles:
阅读(629) | 评论(0) | 转发(0) |