I'm writing a method in Java that I want to simulate references.. Since java doesn't have the out keyword like in C# and doesn't have References/Pointers like in C++, I want to know if I can use reflection to simulate it.
An example would be:
public static boolean ChangeValue(Object Input, Object Output) {
//Use some reflection here to change the value of Output?
return true;
}
then in main:
public static void main(String[] args) {
int I = 0;
ChangeValue(I, I);
System.out.println(I);
}
So.. Can I use reflection to change the value of any parameter passed to my ChangeValue method? I do not want to return Composite objects..