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

How is class defined?

596


write a program to find 2 power of a 5digit number with out using big int and exponent ?

1903


What does it mean when someone says I oop?

594


Can enum be null?

594


if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?

2766






How do you achieve runtime polymorphism?

575


write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.

1797


what type of questions

1701


State what is encapsulation and friend function?

708


What are two types of polymorphism?

622


Whats is abstraction in oops?

595


Why is abstraction needed?

575


What is an interface in oop?

602


what are the different types of qualifier in java?

1847


What is the point of oop?

664