更新时间:2022-04-15 00:54:42
您可以将 this
作为参数传递给第二个函数。
You can pass this
as a parameter to the second function.
public class exClass {
public int aVariable;
public exClass()
{
othClass.aMethod(this);
}
}
public class othClass{
static void aMethod(exClass x)
{
x.aVariable = 0; //or call a setter if you want to keep the member private
}
}