Java   View all facts   Glossary   Help
principle > is-a versus has-a principle
Next principle: look-it-up principle    Up: principle    Previous principle: explicit-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 principle: look-it-up principle    Up: principle    Previous principle: explicit-representation principle