Comment Comment by bedobi java offers composition, like pretty much all programming languagesif you have a person class and you have students and teachersthe correct thing to to is NOT to make student and teacher inherit from personit's to make student and teacher have a person attribute + the other attributes that constitute a student and teacher respectively parent bedobi 2 years ago
if you have a person class and you have students and teachers
the correct thing to to is NOT to make student and teacher inherit from person
it's to make student and teacher have a person attribute + the other attributes that constitute a student and teacher respectively