Class A
で作成した変数の名前を に渡す必要があるClass B
ため、その変数 ( ) に値を入れることができますClass B
。しかし、クラス BI ではその変数の名前を知りません。コードは次のようなものです。
クラスA
public class A {
int valore; // this is the variable, in Class b, I don't know this name!
public void callClassB(){
ClassB.Method(what shoudld i put here?)
}
}
こちらはB級
public class B {
public void Method(the_Name_Of_TheVariable_I_get){
the_Name_Of_TheVariable_I_get = 5; // i need to do this
}
}