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
Explain implementation and how is it different from conversion?
Why do we create public static method in java?
What is a “stateless” protocol ?
How to write custom exception in java?
What is hash code collision?
What is the use of beaninfo?
List the interfaces which extends collection interface?
If try block is successfully executed, Then Is Finally block executed?
What is protected in java?
When is the finalize() called?
How is it possible for two string objects with identical values not to be equal under the == operator?
Is it possible to cast an int value into a byte variable? What would happen if the value of int is larger than byte?
What is the applet security manager, and what does it provide?
How do we access static members in java?
What is the original name of java?