Difference between Interface and Abstract Class



Q) What’s the difference between an interface and an abstract class?
A) An abstract class may contain code in method bodies, which is not allowed in an interface. With abstract classes, you have to inherit your class from it and Java does not allow multiple inheritance. On the other hand, you can implement multiple interfaces in your class.

Random Posts

  • How to get a Leap Year
  • JSF Important Questions
  • Java RMI Interview questions
  • ArrayList Class
  • Define MultiTasking in Java

Post a Comment