If GetA () is changed to a static method, you can simply call it in the GetB () function:
class a {
public static void GetA() {
}
}
class b {
public void GetB() {
a.GetA();
}
}
If GetA () is not static, this makes no sense, because by definition GetA () requires an object context (for example, the invisible pointer "this"). You cannot pass an instance of object B to class A, because class A knows nothing about class B.
What are you really trying to do?
source
share