Multiple choice technology programming languages

Is it OK if a class definition implements two interfaces, each of which has the same definition for a constant PI?

  1. True

  2. False

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

This is False due to constant ambiguity. When a class implements two interfaces that both define the same constant (PI), Java cannot determine which interface's constant to reference. This causes a compilation error. The constant must be explicitly qualified with the interface name (e.g., MyInterface1.PI) to resolve the ambiguity.