Home » JAVA Programming » Interfaces » Question
  1. What happens when we access the same variable defined in two interfaces implemented by the same class?
    1. The JVM is not able to identify the correct variable
    2. Compilation failure
    3. The interfaceName.variableName needs to be defined
    4. Runtime Exception
    5. None of these
Correct Option: C

The JVM needs to distinctly know which value of variable it needs to use. To avoid confusion to the JVM interfaceName.variableName is mandatory.



Your comments will be displayed only after manual approval.