Java Foundations — Question 48
Identify two class variables.
Answer options
- A. private static int numberOfSquares = 20;
- B. public static int counter = 0;
- C. private Measure cm;
- D. public int size = 10;
- E. int scale = 35;
Correct answer: A, B
Explanation
The correct answers, A and B, are both declared as 'static', which means they belong to the class itself rather than instances of the class. Options C, D, and E are instance variables, as they do not have the 'static' modifier and are tied to specific instances of the class.