BlackBerry interview question

Difference between abstract class and interface

Interview Answer

Anonymous

9 June 2011

Abstract classes are a special type of class that is meant to enforce a hierarchy when designing a program. They cannot be instantiated, only inherited. Wthin their implementation, they can have unimplemented methods and implemented methods as well. Interfaces are an entitty which contain only unmplemented methods. They are used with the keyword implements, and once they are implemented wthin a class, all methods within the interface must be used within the class. A class can implement more then one interface. Since Java doesn't support multiple inheritance, this is a shortcut way to have some of that functionality