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

Are polymorphisms mutations?

900


What is for loop and its syntax?

811


What is static in oop?

835


What is abstraction in oops?

801


Why we use classes in oop?

791


What is polymorphism and example?

785


What is the difference between inheritance and polymorphism?

808


What is polymorphism and its types?

817


hi all..i want to know oops concepts clearly can any1 explain??

1898


What is the purpose of polymorphism?

890


What does <> mean pseudocode?

853


What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?

1906


What is abstraction with example?

838


What is static modifier?

852


What is abstract class in oop?

756