Inherit the road like Java learning

Here Insert Picture Description


Class inheritance

Inheritance is one of the three basic features of object-oriented, is an important means to achieve repeatable software, Java is the inheritance of each sub-class has only one direct parent!

Java inheritance is achieved through the extends keyword, straight inherited class is a subclass, the parent class is inherited, and some referred to as the base class, superclass. The relationship between parent and child classes, I use the article on the two 15 tons weight of the cat, for example, the yellow hearts and their properties are cats, so that the yellow and inherited from their hearts cat, cats are the parent, and the yellow is a subclass of hearts!

The hero of the current program are on yellow, hearts, male tiger and tigress four!

Inherited format:

/**
 * CSDN程忆难
 * https://myhub.blog.csdn.net/
 */
修饰符 class

Guess you like

Origin blog.csdn.net/qq_40881680/article/details/104465727