140k views
2 votes
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.

User Jack Guy
by
8.2k points

1 Answer

5 votes

Answer:

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

Step-by-step 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.

User Bsiamionau
by
7.7k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.