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
How do you add an element to an arraylist in java?
What is exception hierarchy in java?
How many return statement are allowed in a function?
Which collection does not allow duplicates in java?
What is tostring () method?
What are the practical benefits, if any, of importing a specific class rather than an entire package (e.g. Import java.net.* Versus import java.net.socket)?
What is classname class in java?
Is nullpointerexception checked or unchecked?
If you are given the name of the function at run time how will you invoke the function?
What is the size of int in 64-bit jvm?
Can java list contain duplicates?
What is finalize()? Is finalize() similar to a destructor?
What is procedure overloading?
How do I remove a character from a string in java?
What carriage return means?