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
What are encapsulation, inheritance and polymorphism?
What is passed by reference and pass by value ?
Can we override constructors in java?
Is int a class in java?
Explain about the performance aspects of core java?
What do negative exponents mean?
What is the difference between dom and sax parser in java?
Why we do exception handling in java and how many types of exceptions are there?
What do you understand by the term string pool?
Explain 5 io best practices?
What is binary search in java?
What is difference between arraylist and list in java?
What do the thread?class methods run() and start() do?
what is collatration?
What is the purpose of the return statement?