Java Compile-Time Syntax Error
Which of the following best describes the compile-time error in the code segment below?
public class Debug {
public static void main(String[] args) {
int num = 5
int sum = num + 10;
System.out.println(sum);
}
}
A
Undeclared variable used in the expression.
B
Incorrect variable type used for num.
C
Improper method invocation in main.
D
Missing semicolon after the declaration of num.
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | waynechen0110 | 2 | 2 | 0m 00s | 200 |
| #2 | nityameda | 2 | 2 | 0m 47s | 153 |
| #3 | lsj08030922 | 2 | 2 | 0m 52s | 148 |
| #4 | avantikaabaid10901 | 1 | 1 | 0m 00s | 100 |
| #5 | sailajavadlamani33 | 1 | 1 | 0m 00s | 100 |
| #6 | sgarv2513 | 1 | 1 | 0m 00s | 100 |
| #7 | varunrajaram1 | 1 | 1 | 0m 00s | 100 |
| #8 | hiboyshello | 1 | 1 | 0m 00s | 100 |
| #9 | patrickmeijer009 | 1 | 1 | 0m 08s | 92 |
| #10 | l.alzahrani04 | 1 | 2 | 0m 00s | 90 |
APFIVE