APFIVE APFIVE | preferred AP College board partner for AP classes
Login
 
Register
AP Classes
AP Human Geography AP Computer Science A AP Comparative Government and Politics AP European History AP Macroeconomics AP Microeconomics AP Psychology AP United States Government and Politics AP United States History AP Calculus AB AP Calculus BC AP Computer Science Principles AP Precalculus AP Statistics AP Biology AP Chemistry AP Environmental Science AP Chinese AP Art History AP English Literature AP Research AP Spanish Literature AP Art & Design AP World History: Modern AP English Language AP French AP German AP Japanese AP Latin AP Italian AP Spanish Language AP Music Theory AP Physics 1 AP Physics 2 AP Physics C: Mechanics AP Physics C: E&M AP African American Studies
AP Computer Science A/Unit 1: Primitive Types
Start Practice Test
Share
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.

Check Answer
APFIVE © 2020.
Email: [email protected]|Privacy Policy