DEVFYI - Developer Resource - FYI

What's the difference between an interface and an abstract class?

Java Interview Questions and Answers (part 1)


(Continued from previous question...)

8. What's the difference between an interface and an abstract class?

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.

(Continued on next question...)

Other Interview Questions