adplus-dvertising
frame-decoration

Question

What happens when we access the same variable defined in two interfaces implemented by the same class?

a.

Compilation failure

b.

Runtime Exception

c.

The JVM is not able to identify the correct variable

d.

The interfaceName.variableName needs to be defined

Posted under Java Programming

Answer: (d).The interfaceName.variableName needs to be defined

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What happens when we access the same variable defined in two interfaces implemented by the same class?

Similar Questions

Discover Related MCQs

Q. Can “abstract” keyword be used with constructor, Initialization Block, Instance Initialization and Static Initialization Block.

Q. Which of these package is used for graphical user interface?

Q. Which of this package is used for analyzing code during run-time?

Q. Which of this package is used for handling security related issues in a program?

Q. Which of these class allows us to get real time data about private and protected member of a class?

Q. Which of this package is used for invoking a method remotely?

Q. Which of these type parameters is used for a generic class to return and accept any type of object?

Q. Which of these type parameters is used for a generic class to return and accept a number?

Q. Which of these is an correct way of defining generic class?

Q. Which of the following is an incorrect statement regarding the use of generics and parameterized types in Java?

Q. Which of the following reference types cannot be generic?

Q. A java interface can contain _______.

Q. Which of the following is a correct interface?

Q. Which of the following classes directly implement Set interface?

Q. Which is the correct way to inherit and implement the interface?

Q. Which of the following is true about methods in an interface in java?

Q. Can "abstract" keyword be used with constructor, Initialization Block, Instance Initialization and Static Initialization Block.

Q. Package in Java is a mechanism to encapsulate a ______________.

Q. Package names and directory structure are closely related.

Q. An _______________ statement can be used to access the classes and interface of a different package from the current package.