I'm relatively new to programming and for one of my classes I have to create a class hierarchy for the following things: Country
, State
, County
, City
, Boundary
, and River
.
How would I do this?
I think I understand that I cannot use extends
because it implies that one thing IS-A different thing, is that the correct way to think about it? Also, I understand that there is a HAS-A relationship in Java but I do not know how to use it, do I just create separate class files? Or, are there any other ways to do this?
Thanks for any help!