| preferred AP College board partner for AP classes
AP Computer Science A/Unit 1: Primitive Types
Start Practice TestPractice Test
About Exam
medium Solved by 83 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

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.

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

Question Leaderboard

Rank
User
Correct Count
Attempt Count
Time
Score
#1waynechen011022 0m 00s 200
#2mason.lilley22 0m 26s 174
#3nityameda22 0m 47s 153
#4lsj0803092222 0m 52s 148
#5hiboyshello11 0m 00s 100
#6varunrajaram111 0m 00s 100
#7sgarv251311 0m 00s 100
#8sailajavadlamani3311 0m 00s 100
#9avantikaabaid1090111 0m 00s 100
#10testsss111 0m 01s 99
Items per page:
10
1 – 10 of 43
No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy