Pergunta de entrevista da empresa Intuit

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

Respostas da entrevista

Sigiloso

28 de jan. de 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

Sigiloso

24 de fev. de 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.