From the below code, the class B is the subclass of class A. After the instance a is created, the method go is called. Java run this method of the class B. And the value of the attribute x is changed within the method go.
Then I display the value of the attribute x of a. The initial value of x in class A is shown. My question is why doesn't Java show the lastest value of x after the method go finish ?
output >>
B.go() : x = 600
x = 10
----------------------------
B.go() : x = 600
x = 600
[edit]Add code tags. CR[/edit]
[ August 27, 2008: Message edited by: Campbell Ritchie ]