Domanda di colloquio di Intuit

What is the difference between an abstract class and an interface?

Risposte di colloquio

Anonimo

28 gen 2012

An abstract class can provide a default implementation, while an interface cannot. Both aren't very exciting by themselves, and need to have classes that extend them. [Gave an example about abstract class].

1

Anonimo

24 feb 2012

In an interface none of the methods that are declared can have a body while in an abstract class there can be some methods which have a body and some dont. Also there can be other variables declared in an abstract class but in an interface if a variable is declared it should be declared as final.