Which of the following can potentially be changed when implementing an interface?
Group of answer choices
a. The return type of a method defined by the interface.
b. The parameters of a method defined by the interface.
c. You cannot change the name, return type, or parameters of a method defined by the interface.
d. The name of a method defined by the interface.

Answer :

Answer:

c. You cannot change the name, return type, or parameters of a method defined by the interface.

Explanation:

When implementing an interface:

  • The return type of the implementing method should be same as the one defined in the interface.
  • The parameters of the implementing method should be the same as defined in the interface.
  • The name of the method should be the same as that defined in the interface.

So among the given options , option c is the most relevant as it captures all the above conditions.

Other Questions