what is the main difference between interface and abstract class

Hi ,Please help on this ..Regards,vij
[65 byte] By [vijay.mandapatia] at [2007-11-27 7:40:32]
# 1
http://onesearch.sun.com/search/onesearch/index.jsp?qt=difference+between+interface+and+abstract+class&subCat=&site=dev&dftab=&chooseCat=javaall&col=developer-forums
CeciNEstPasUnProgrammeura at 2007-7-12 19:21:03 > top of Java-index,Java Essentials,Java Programming...
# 2
short answer is "You can't implement two abstract base classes."
corlettka at 2007-7-12 19:21:03 > top of Java-index,Java Essentials,Java Programming...
# 3

Difference between interface and abstract:

All the methods declared inside interface should be abstract, and there is no need to use the key word 揳bstract?for those method, but in case of abstract class at least one method should be abstract, most importantly u have to use the 揳bstract?key word for that method, besides that it may contain concrete methods. Abstract class must be extended abstract () methods generally contain only declaration part without definition part.

chinmaysahooa at 2007-7-12 19:21:03 > top of Java-index,Java Essentials,Java Programming...
# 4
> but in case of abstract> class at least one method should be abstract, Why? Whether I make a class abstract or not is very often a pure design decision with me, and not because there's an abstract method.
CeciNEstPasUnProgrammeura at 2007-7-12 19:21:03 > top of Java-index,Java Essentials,Java Programming...
# 5

> All the methods declared inside interface should be abstract

All the methods declared for an interface are abstract, by definition.

> but in case of abstract class at least one method should be abstract

No. An abstract class is not required to have any abstract methods. It's not even a "should".

> Abstract class must be extended abstract ()

> methods generally contain only declaration part

> without definition part.

No "generally" about it, as there are no exceptions. Abstract methods do not have a declared body, by definition.

~

yawmarka at 2007-7-12 19:21:03 > top of Java-index,Java Essentials,Java Programming...