employer cover photo
employer logo
employer logo

Information Management Services

Is this your company?

Information Management Services interview question

What is inheritance? What is an abstract class and what is an interface? (In Java)

Interview Answer

Anonymous

22 July 2016

Inheritance is considered an "is-a" relationship. It imports classes into other classes without that class needing to create an object. Any public methods or variables are able to be used by the class inheriting from the super-class. It's a mechanism for code reuse. An abstract class is denoted by the abstract keyword, and simply means that it has abstract methods. These methods have been declared but are uninitialized, and are meant to be initialized by the inheriting class. The interface is essentially an empty class with initialized, but empty, methods.

1