When we write Java programs, we sometimes see a situation like this.
For example:
Class b{}
Class a{}
New A (b)//In this statement, Class A contains class B meaning that any data of Class B can be invoked directly using Class B object class
Here I use the human body to make a metaphor
For example, there is a human class person{}
Have a header class head{}
There is a body class body{}
There is a lower extremity class foot{}
Here, let's create a header class.
Head H =new head ();
A Body class
Body b=new body ();
A lower extremity class
Foot F =new foot ();
Finally, create a human object.
Person p = new person (h,b,f);
In person you can arbitrarily invoke any property of any property of the body by any attribute of the head, so that you can divide this man more carefully and also get you to be more flexible with this person's object
Don't know the right to say hey!
The role of classes contained in Java