Class relationship
Association:
There are two-way and one-way.
The two-way association between class An and class B can be an attribute of each other.
One-way means that one of the classes acts as an attribute in the other class
For example:
Public class Person {
Hourse head=new Hourse ()
}
Dependence:
Dependency is only one-way, and there is no attribute problem. For example, class A depends on class B, which indicates that there are three types of B in class A:
First, class B is global.
Second, class B is instantiated in class A.
Third, class B is passed as a parameter.
Public class Person {
Public void buy (Hourse hs) {
}
}