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
Are polymorphisms mutations?
What is for loop and its syntax?
What is static in oop?
What is abstraction in oops?
Why we use classes in oop?
What is polymorphism and example?
What is the difference between inheritance and polymorphism?
What is polymorphism and its types?
hi all..i want to know oops concepts clearly can any1 explain??
What is the purpose of polymorphism?
What does <> mean pseudocode?
What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?
What is abstraction with example?
What is static modifier?
What is abstract class in oop?