what is difference between abstract and interface?
can i give real time example for the two topics?
Answer Posted / srinu
interface:interface contain only undefined methods
Abstract: Abstract class contain some undefined methods 0r
some defined methods or all defined methods.
Ex: Real time Example
interface Father
{
public void studyDaily();
public void dailyGotoCollege();
}
Abstrct class Son implements Father
{
public Void studyDaily();---->But his son didnot Study
daily he does n't interet Daily
public void dailyGotoCollege()
{
System.out.println("yes Father I go to college");
}
}
| Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
Does set allows null in java?
Write a program to find the whether a number is an Armstrong number or not?
Can a top level class be private or protected?
What is the difference between JDK and JVM?
What are different access specifiers in java?
What is java autoboxing?
What happens to a static var that is defined within a method of a class?
What is array size in java?
How many digits is int32?
Can you give names of Container classes?
What sorting algorithm does javascript use?
Why Java doesn’t support multiple inheritance?
Define inheritance with reference to java.
Is namespace same as package in java?
What is the primitive type byte?