| 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
< Prev
Next >

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;

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.

No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: [email protected]|Privacy Policy