In Java, how do you set variables in a calling object from the object that is being called? I guess I could set up some kind of struct class, but can someone show me if there is a simpler way to do it, such as some modification of the pseudocode below:
public class Example(){
int thisInt;
int thatInt;
public static void main(String[] args){
Another myAnother = new Another();
}
setThisInt(int input){thisInt=input;}
setThatInt(int input2){thatInt=input2;}
}
public class Another(){
void someFunc(){
this.Example.setThisInt(5);//I know this syntax is wrong
this.Example.setThatInt(2);//I know this syntax is wrong
}
}