| preferred AP College board partner for AP classes
medium Solved by 45 students
Java Compile-Time Syntax Error
< Prev
Next >

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.

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

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Time
Score
#1waynechen011022 0m 00s 200
#2nityameda22 0m 47s 153
#3lsj0803092222 0m 52s 148
#4avantikaabaid1090111 0m 00s 100
#5sailajavadlamani3311 0m 00s 100
#6sgarv251311 0m 00s 100
#7varunrajaram111 0m 00s 100
#8hiboyshello11 0m 00s 100
#9patrickmeijer00911 0m 08s 92
#10l.alzahrani0412 0m 00s 90
APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy