DEVFYI - Developer Resource - FYI

You can create an abstract class that contains only abstract methods. On the other hand, you can create an interface that declares the same methods. So can you use abstract classes instead of interfaces?

Java Interview Questions and Answers (part 3)


(Continued from previous question...)

453. You can create an abstract class that contains only abstract methods. On the other hand, you can create an interface that declares the same methods. So can you use abstract classes instead of interfaces?

Sometimes. But your class may be a descendent of another class and in this case the interface is your only option.

(Continued on next question...)

Other Interview Questions