There are two classes A class B
Direct friends:
B是A的 成员变量
B是A中 方法的参数
A的 方法返回值是B类型
The member variable is
class A{
private B b;
}
Parameters in the method
class A{
public void hello(B b){
}
}
Method return type
class A{
public B hello(){
}
}
Unfamiliar class:
The unfamiliar class is equivalent to the tool class, like B is the tool class of A, but the class is used in the method
class A{
public hello(){
B b=new B(); //B是陌生的类
}
}