Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
AP Computer Science A/Unit 5: Writing Classes
Start Practice TestPractice Test
About Exam
easy Solved by 1 students

Declaring and Initializing Static Variables

Mark
< Prev
Next >

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;

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Not enough data yet to show leaderboard.

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy|