Which of the following statements about statically typed languages is true?

2025

Which of the following statements about statically typed languages is true?

  1. A.

    Types are associated with values, not variables

  2. B.

    Variable types can change during execution

  3. C.

    Type checking is done at runtime

  4. D.

    Type errors are caught during compilation

Attempted by 65 students.

Show answer & explanation

Correct answer: D

Statically typed languages require variable types to be declared at compile time. This allows for early error detection and better performance optimization compared to dynamically typed languages.

Explore the full course: Niacl Ao It Specialist