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
What is the benefit of oop?
Why interface is used?
What is static modifier?
what type of question are asked in thoughtworks pair programming round ?
They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?
Write a program to sort the number with different sorts in one program ??
Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.
what are the different types of qualifier in java?
write a programe to calculate the simple intrest and compund intrest using by function overlading
What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?
Will I be able to get a picture in D drive to the c++ program? If so, help me out?
What does and I oop mean in text?
write a C++ program for booking using constructor and destructor.
What is encapsulation process?
What is the purpose of polymorphism?