Declaring and Initializing Static Variables
Develop code to declare the class variables that belong to the class.
Which of the following code segments correctly declares and initializes class (static) variables in Java?
A
private static int count = 0;
private static final int MAX_COUNT = 100;
private static boolean isEnabled = true;
B
private static int count;
private static final int MAX_COUNT;
private static boolean isEnabled;
C
static private int count = 0;
final static int MAX_COUNT;
static boolean isEnabled = true;
D
private int static count = 0;
private final static int MAX_COUNT = 100;
private boolean static isEnabled = true;
Question Leaderboard
Not enough data yet to show leaderboard.
APFIVE