You got 2 different types of classes
- the outer class
- the nested class (this is not true in every case the inner class)
We already saw how to create a class. And maybe did you already saw the classes PrintStream, Scanner, Math. It is important to know what the classes can do and how to use them.
A class is some area in which you describe the characteristics of a thing. You could compare it to real life objects/things. Like for example animals. If you make a game about a farm. Then is there, for example, a class Animals. Every animal has its own characteristics. You could see the class Animals as the class which contains different animals. And the specifications of every animal will be in the class of the animal itself.
Class Animals:
Box 0 | Sheep |
Box 1 | Cow |
Box 2 | Goat |
Box 3 | Chicken |
So, if you look at the characteristics of every animal you see, for example, in the Class Sheep:
In this way is it possible that one sheep is different from another sheep.