Both. Usually objects in the world can be regarded in several ways.
With object oriented programming, you define software objects that mimic "real world" objects. This makes programs easier to think about and more reliable. In the real world, you often think about an object in several different ways. You can think of your car as a vehicle or as taxable property. It would be convenient if software objects, also, could be thought of in several ways. But a Java object belongs to just one class.
An interface describes aspects of a class other than those that it inherits from its parent. An interface is a set of requirements that the class must implement.
An interface is a list of constants and method headers. The methods are not implemented in the interface (there is no method body). A class that implements an interface must implement each of the methods listed in the interface.
A class can extend one parent class to inherit the methods and instance variables of that parent. A class can also implement an interface by including additional methods and constants. However, the methods in the interface must be explicitly written as part of the class definition. The interface is a list of requirements that the class definition must include (through explicit code, not through inheritance).
For example, a class
Inheritance then gives it all the methods and instance variables of
Car also implements the
then its definition must contain code for all the methods listed in
Can an interface include instance variables?