Pergunta de entrevista da empresa Amazon

Standard OOPS concepts like diff between interface and abstract class.

Respostas da entrevista

Sigiloso

8 de set. de 2011

An abstract class is a class that can't be instantiated directly and must be inherited to create a concrete class. An interface is an abstract class which provides no default implementation and just specifies the functionality a concrete class much implement.

1

Sigiloso

28 de set. de 2011

I believe the best answer would be to say Interface does not have any default definition for a function whereas abstract class can.. So when we need to define some sort of default implementation, abstract class are better than interfaces. What SCH is correct too

1

Sigiloso

2 de jul. de 2011

An interface is a group of related methods with empty bodies. An abstract class is a class that is declared abstract.