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


Please Help Members By Posting Answers For Below Questions

Is final static java?

552


Where import statement is used in a java program?

610


What advantage do java's layout managers provide over traditional windowing systems?

548


Why a dead thread occurs?

578


Convert Binary tree to linked list.

591






What is the difference between jfc & wfc?

599


Give me example of derived data types.

594


Are static members inherited to sub classes?

642


Explain about main() method in java ?

585


What are register variables what are the advantages?

451


Does java support multiple inheritance or not?

605


What is an array length?

500


What are the fileinputstream and fileoutputstream?

571


Why super is first line in java?

563


Is string an object?

656