I am confuzed about this OO program i am making....
well my question is basically about the design of the object.
if i have an Object A, and this object is inherited by Objects B and C....if B trys to change a public variable within A by one of A's public method's.....then when C trys to access the same variable would C get the newly changed value or is it something completly different.
if the above does not work...how would i design the objects so that B and C both can access methods within A and also gets's the updated changes that A's method modified by objects B or C?
For example: Object A has method called IncrementNUMbyOne(int NUM); (assuming num is one to start with; NUM is a pub var in Object A)
Object B and C inherits object A;
Object B calls IncrementNumbyOne(NUM); (and now num is 2)
if Object C calls IncrementNumbyOne(NUM)---> would num be 2 or 3?? if its 2 how would i design this so that it returns 3.
well my question is basically about the design of the object.
if i have an Object A, and this object is inherited by Objects B and C....if B trys to change a public variable within A by one of A's public method's.....then when C trys to access the same variable would C get the newly changed value or is it something completly different.
if the above does not work...how would i design the objects so that B and C both can access methods within A and also gets's the updated changes that A's method modified by objects B or C?
For example: Object A has method called IncrementNUMbyOne(int NUM); (assuming num is one to start with; NUM is a pub var in Object A)
Object B and C inherits object A;
Object B calls IncrementNumbyOne(NUM); (and now num is 2)
if Object C calls IncrementNumbyOne(NUM)---> would num be 2 or 3?? if its 2 how would i design this so that it returns 3.