KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm writing documentation for an object-oriented language, and I wonder what kind of classes would be a good example for inheritance. Some common examples: class Person { } class Employee extends Person { } Currently my favorite, but I don't like Person->Employee because 'Employee' does not exactly look like fun. class Bicycle { } class MountainBike extends Bicycle { } I found this in some Java tutorial , but it's not really obvious what attributes a bike should have. class Animal { } class Bird extends Animal { } Same as the bicycle. class A { } class B extends A { } Too abstract. The main problem is that such a class will need even more abstract attributes and methods. Does anyone have a better example for a simple class hierarchy?
Tags (comma-separated)
Save Edits
Cancel