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

Which class is the superclass of all classes?

861


What is meant by binding in rmi?

808


String and stringbuffer both represent string objects. Can we compare string and stringbuffer in java?

772


how can i use a nonsynchronized hashtable?

2339


what are the states associated in the thread? : Java thread

849


What does function identity () do?

749


What are the library functions in java?

804


Can constructor be inherited?

819


If an application has multiple classes in it, is it okay to have a main method in more than one class?

780


What is executor memory?

744


Why do we need strings in java?

735


What is the byte order of byte buffer?

804


How to set the permissions to a file in java?

776


What is ctrl m character?

764


Is null a string?

784