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
Improper method invocation in main.
B
Missing semicolon after the declaration of num.
C
Undeclared variable used in the expression.
D
Incorrect variable type used for num.
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | waynechen0110 | 2 | 2 | 0m 00s | 200 |
| #2 | mason.lilley | 2 | 2 | 0m 26s | 174 |
| #3 | nityameda | 2 | 2 | 0m 47s | 153 |
| #4 | lsj08030922 | 2 | 2 | 0m 52s | 148 |
| #5 | hiboyshello | 1 | 1 | 0m 00s | 100 |
| #6 | varunrajaram1 | 1 | 1 | 0m 00s | 100 |
| #7 | sgarv2513 | 1 | 1 | 0m 00s | 100 |
| #8 | sailajavadlamani33 | 1 | 1 | 0m 00s | 100 |
| #9 | avantikaabaid10901 | 1 | 1 | 0m 00s | 100 |
| #10 | testsss1 | 1 | 1 | 0m 01s | 99 |
Items per page:
10
1 – 10 of 43
APFIVE