Undeclared Variable Error
What error prevents this code from compiling?
public class Person {
public static void main(String[] args) {
age = 30;
}
}
A
The variable ‘age’ is used without being declared.
B
There is an extra semicolon in the code.
C
The class declaration is missing the public keyword.
D
The main method is missing a String array parameter.
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | sgarv2513 | 1 | 1 | 0m 00s | 100 |
| #2 | kaisuki | 1 | 1 | 0m 00s | 100 |
| #3 | bommasam000 | 1 | 1 | 0m 17s | 83 |
| #4 | zgj07310417 | 1 | 1 | 0m 59s | 41 |
Items per page:
10
1 – 4 of 4
APFIVE