What are interfaces?

Interfaces provide more sophisticated ways to organize and control the objects in your system. The interface keyword takes the abstract concept one step further. You could think of it as a “pure” abstract class. It allows the creator to establish the form for a class: method names, argument lists, and return types, but no method bodies. An interface can also contain fields, but The interface keyword takes the abstract concept one step further. You could think of it as a “pure” abstract class. It allows the creator to establish the form for a class: method names, argument lists, and return types, but no method bodies. An interface can also contain fields, but An interface says: “This is what all classes that implement this particular interface will look like.” Thus, any code that uses a particular interface knows what methods might be called for that interface, and that’s all. So the interface is used to establish a “protocol” between classes. (Some objectoriented programming languages have a keyword called protocolto do the same thing.)

Showing Answers 1 - 4 of 4 Answers

Interface:
What a Class must do, But not how-to.
Bridge for the communication when the caller does not know to whom he is calling.
Describes externally visible behavior of element.
Only Public members which defines the means of the communication with the outer world. Can-be-Used-As Relationship.
Can not contain data but can declare property. There can be no implementation. Interface can be derived from another interface.

  Was this answer useful?  Yes

subroto

  • Sep 28th, 2007
 

Interfaces are the Pure Abstract class.which is use in java for the multiple inheritance. As we know that in java multiple inheritance is not possible,Interface is the Answer for this problem.

  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