An interface is a contract that defines a set of methods that a class must implement. It provides a way to ensure that a class adheres to a certain contract, even if it is part of an inheritance hierarchy.