Java - Class Hierarchy -


I'm relatively new to programming and one of my classrooms I have to create a class hierarchy for the following things : country , state , county , city , border And river .

How do I do this?

I think that I understand that I can not expand because it means that there is one thing - a different thing is that the right way to think about it is? Also, I understand that Java has HAS-A relationships but I do not know how to use it, should I create different class files? Or, is there any other way to do this?

Thanks for any help!

Think about things that are similar

country, state, county, The cities are all geographical institutions that can accommodate each other.

A river is a geographical unit that can cross human defined boundaries.

A limitation is something that helps to describe any of the above.

There are some qualities in country, state, county, city and river all. For example, they probably have a name for everyone, they all have bunderies also, that means they should probably share a common base class (perhaps geographical difference).

There is a hierarchy in the country, state, county, city, and these are human definitions. You can consider the sub-section of the geographical difference, called PoliticalEntti, which has some things: < Ul>

  • The guardian political difference which is
  • List of zero or more institutions that are included (for example, there are states in one country).

    Note that things are not quite simple in real life (there are cities that are cross-county or even the state lines), but to learn the issues of those leads Probably can be ignored.

  • Comments

    Popular posts from this blog

    Verilog Error: output or inout port "Q" must be connected to a structural net expression -

    jasper reports - How to center align barcode using jasperreports and barcode4j -

    c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -