JAVA
public class A {
string amountA;
B b;
}
public class B {
string amountB;
public void setValue(String value) {
amountB = value;
Also, I need to set amountA = value;. Is it possible? See main method
}
}
... main(String... args) {
A a = new A();
B b = a.getB(); // b is a member of A
b.setValue("25") // this should also change 'amountA' in object 'a' to '25'
}