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
How is class defined?
write a program to find 2 power of a 5digit number with out using big int and exponent ?
What does it mean when someone says I oop?
Can enum be null?
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?
How do you achieve runtime polymorphism?
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.
what type of questions
State what is encapsulation and friend function?
What are two types of polymorphism?
Whats is abstraction in oops?
Why is abstraction needed?
What is an interface in oop?
what are the different types of qualifier in java?
What is the point of oop?