test question

Run into a question in a test recently, not quite sure what is the right answer? Any suggestion?

Thanks


What kind of variable do you use if you need to share a variable from one instance of a class to the next?

1 volatile
2 register
3 static
4 protected
5 auto
This is an easy one. You should try and figure this out first.
i think only static make sense to have a single variable shared by the same type of classes. but the sentence of "from one instance of a class to the next" confuse me a little bit. not sure whether that is what it asks me.
thanks
It's not very well redacted, but yes, the answer is 3.
Topic archived. No new replies allowed.