Java Programming Chapter 4——Object characteristics 2: inheritance (1)
·
Object characteristics 2: inheritance (1)
1. Inheritance reflects an’ is-a’ relationship between classes.
2. Judge whether dog is an animal? -the dog is an animal, which is obviously established. It is obviously not true that a car is an animal. Parent and subclass.
Example: If an animal is a parent, a dog is a subclass.
更多推荐




所有评论(0)