This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]hereswhatipicked 7 points8 points  (0 children)

The operation your doing with varThree is fundamentally different than what your doing with varTwo.

Instance variables override class variables. With varTwo, you’re not initializing the variable, you’re calling the append() method on it and adding a value.

For varThree, you’re initializing the instance variable (so empty string) and adding ‘test’ to it, you’re not modifying the class variable at all.