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

Answer Posted / amit upadhyay

interface is collection of abstract method.we can not
define any method in interface.we can implement that
abstract method by using the class.there is a restriction
in interface that you have to implement all the abstract
method in the class which is declared in interface.and we
can not create an object of interface.if we want to execute
the interface method then we have to implement first that
interface in any class after that create the object of
class ,then we can access execute that method


but in class we have to define the methods, which is
declered.we can also access that method through the object
of the class.

Is This Answer Correct ?    9 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

i got a backdoor offer in process global,Bangalore..Can i work with it?

2595


What is the renewal class?

2437


What is abstraction example?

851


Why interface is used?

770


What does enum stand for?

886


What is encapsulation in oop?

805


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

1905


Why polymorphism is used in oops?

808


Why do pointers exist?

897


What are the benefits of polymorphism?

880


What is interface in oop?

890


How to hide the base class functionality in Inheritance?

875


write knight tour problem which is present in datastructure

2397


Can a varargs method be overloaded?

834


Why is polymorphism used?

794