Multiple choice technology programming languages

Variables in the interface must be initialized and are static & final.

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Interface variables are implicitly public, static, and final in Java. Static means they belong to the interface, not any instance. Final means they must be initialized and cannot be changed. This makes interfaces ideal for defining constants: implementing classes share these values without creating copies. The statement is accurate.

AI explanation

In Java, all fields declared in an interface are implicitly public static final, meaning they're constants shared at the interface level (not per-instance), and because final fields can't be assigned later, they must be given an initial value at the point of declaration — the compiler enforces this. This is a core, well-defined Java language rule, so the statement is straightforwardly True.