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