Inheritance: Child Class example - Cats can't fetch.

From Book: In this example, you could create an object of type Pet. That object would have a name and could eat() and sleep(), but it could not fetch() or climb().

Spanky is eating

Winky is eating

Spanky is sleeping

Winky is sleeping

Spanky is fetching

Winky is climbing

Toggle Sidebar