Limited access

Upgrade to access all content for this subject

Which of the following are legitimate reasons for using a static variable instead of a non-static variable in a class?

I.    The variable refers to a constant that can be used in other classes
II.   The variable refers to one value that is the same across all instances of the class it is defined in
III.  The variable refers to an important piece of information unique to each new object created from this class
IV.   The variable refers to a count of the number of times a new object from this class is constructed
A

I, II, and III only.

B

I, III, and IV only.

C

I, II, and IV only.

D

II and IV only.

E

III and IV only.

Select an assignment template