Java   View all facts   Glossary   Help
principle > is-a versus has-a principle
Next principlelook-it-up principle    Upprinciple    Previous principleexplicit-representation principle   

is-a versus has-a principle comparison table
Subject is a kind of state is a subtopic of
principlekbTop  
is-a versus has-a principleprinciplethat if you find yourself using the phrase "an X is a Y" when describing the relation between two classes, then the first class is a subclass of the second; if you find yourself using "X has a Y", then instance of the second class appear as parts of instances of the first classInheritance

Next principlelook-it-up principle    Upprinciple    Previous principleexplicit-representation principle