Describe what an Interface is and how it?s different from a
Class.

Answer Posted / seamus barrett

An interface represents a contract between a class and its clients (the classes and functionality that consume the class). A class that implements an interface makes available to it's clients a collection of methods and properties as defined by the interface. As a class evolves (as the code changes) the contract between class and its client remains intact so long as the interface is unchanged. This allows a class to grow without requiring its clients to be rebuilt.

Difference? A class can be instantiated into an object that provides functionality to the instantiating function while an interface cannot be instantiated.

Is This Answer Correct ?    3 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where is pseudocode used?

558


What is the real life example of polymorphism?

601


Whats is abstraction in oops?

585


Why is polymorphism used?

577


What is polymorphism oop?

612






Which is not an object oriented programming language?

530


I have One image (means a group photo ) how to split the faces only from the image?............ please send the answer nagadurgaraju@gmail.com thanks in advace...

1618


what are the ways in which a constructors can be called?

1572


What is debug class?what is trace class? What differences are between them? With examples.

1598


What are the three parts of a simple empty class?

1447


to find out the minimum of two integer number of two different classes using friend function

1635


What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?

2094


What is balance factor?

576


Plese get me a perfect C++ program for railway/airway reservation with all details.

3420


What is abstraction and encapsulation?

563