What must a class do to implement an interface

It must provide all of the methods in the interface and identify the interface in itsimplements clause.

Showing Answers 1 - 10 of 10 Answers

sai

  • Sep 27th, 2005
 

If class wants to implement an interface , it should use implement keyword in its class declaration provide the definitions to the methods of that interface or else it should be declared as an abstract class An interface specifies what a class must do.it species the behaviour of implementing class

  Was this answer useful?  Yes

hemasundar

  • Jan 1st, 2008
 

 If a class has to implement an interface, while writing the class you should use implements key word. Then the class must provide definitions for all the methods that are declared in the interface. It is must. You should provide definitions for all the methods

  Was this answer useful?  Yes

A class (someName) which wants to use features of the interface(someInterfaceName)  must use implements keyword
like

class someName implements someInterfaceName

It must define all the methods in the interface or else you will be facing compile time errors.

If you don't want to define the method you have to declare the class implementing your interface as abstract and define the methods in concrete class that extends this abstract class

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions