Chapter:Classes - Using packages - Exercises

From Juneday education
Jump to: navigation, search

Exercises on grouping stuff in packages

This exercise aims to make you reflect on how one could divide classes into packages.

Given the following classes for some project, how could you divide the classes into directories (and packages) which better describe their role in the project? Be creative! There is not one single answer to this question, you have to use your imagination here.

$ ls -1

Solutions to grouping stuff in packages

Expand using link to the right to see one possible solution.

One possible division could be the following:

|-- literature
|   |--
|   `--
|-- main
|   `--
|-- math
|   `--
|-- test
|   `--
`-- text


Further reading

Where to go next

Next page is: Classes_-_Testing_your_classes

« PreviousBook TOCNext »