Ramu Neelam
What is the difference between Interface and an abstract class if all the methods of abstract class are declared as abstract?
By Ramu Neelam in Java on Nov 26 2006
  • canuja
    Nov, 2006 28

    Neither Interface or Abstract classes can be instantiated. An interface has all public members and no implementation. An abstract class is a class which may have the usual flavors of class members (private, protected, etc.), but has some abstract methods.

    If all the methods of the abstract class is abstract then this class will looks like a Interface but with the restriction that it cannot make a class inherit from it.

    • 1
  • Sreejaya P
    Nov, 2006 29

    Sorry my previous answer was under the impression that it was a CPP question. C# interfaces support properties.

    Still I believe architectural need ie;generalization and realization realtions is the major deofference or which causes all differences which are means to achieve these goals.

    • 0
  • Sreejaya P
    Nov, 2006 29

    An abstract class can have member variables(data mrmbers) where as an interface can have only member functions.

    Interafce is realization utility,Abstract class is generalization utility.(Check OOPc and UML)

    • 0
  • Vimal Verma
    Nov, 2006 27

    logically there is no diff. but there is diff. in some functionality i guess that while creating ur own class u can implement more than one interface but not more than one class

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS