hello everyone... i need some help... how can i sett and get the values in two classes through association. here is my little code that i wrote just to understand the concept of how to modify the one class attributes through association between two classes.
obj.setIDDDD(ob);
obj.getIDDDD(ob);
}
==========================================================
In upper code, i am trying to set the new value in Student class through through teacher class. Setters and getters properly works and change the values with Student class object but when i set the values through Teacher class, it shows the old value sett by the Student Object.
you have to pass by reference, you are passing by value, so setIDDDD(Student s) is creating a local Student and modifying the value of it but its not changing the original Student you passed.