Variables and Data Types

AP Computer Science A· difficulty 1/5

Which line correctly declares an integer variable named <code>count</code> initialized to 10?

  • A

    int count == 10;

  • B

    count int = 10;

  • C

    integer count = 10;

  • D

    int count = 10;

    check_circle

Explanation

Java syntax: <code><type> <name> = <value>;</code> with a single <code>=</code> for assignment.

Want 10 more like this — adaptive to your weak spots?

Related questions