My son is learning to program and we were having a little discussion on "life, scope, and visibility", this the code we came up with to illustrate different questions he had. See if you can walk through it and say why the print is the print that comes out when it comes out. In programming, IMO, most problems come down to life, scope, and visibility.
Out on HF and heard nobody, but didn't call CQ? Nobody heard you either. 73 de N7GH
You are absolutely right, the static definition of i, in the body of the object makes i a Class variable, and it is very useful in some cases, but not if you do not expect what it does. The difference is one thing I wanted my son to see as an introduction fo use of static members.
Les
Out on HF and heard nobody, but didn't call CQ? Nobody heard you either. 73 de N7GH
Hey, I'm supposed to be the guide! Wait up! No fair! You have the tiny ad!
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth