Interfaces are designed to create an abstraction (archetype) of abstraction (classes) of reality (objects).
Interfaces must specify the terms of the contract without providing the implementation provided by the classes.
Interfaces are specifications, as well as a human-readable shell for virtual tables.
Interfaces are development-time artifacts that define the stationary behavior of a concept, because it is one and static.
Classes are implementation-time artifacts that define the mobile structure of reality when it interacts and moves.
What is an interface?
When you watch a cat, you can say that it is an animal with four legs, a head, a body, a tail and hair. You can see that he can walk, run, eat and meow. And so on.
You have just defined an interface with its properties and operations. Thus, you did not determine any mode of action, but only functions and capabilities, not knowing how everything works: you determined abilities and differences.
As such, it is not really a class yet, although in UML we call it a class in a class diagram. Don’t be embarrassed here, because in UML the interface is slightly different from the interface in C #: it looks like a partial access point to an abstraction atom. Thus, we said that a class can implement several interfaces. As such, this is one and the same thing, but not because the interfaces in C # are used both for abstraction and for limiting this abstraction as an access point. These are two different uses. Thus, a class in UML represents an interface that is fully connected to a programming class, while a UML interface represents a section decoupling interface for a programming class. Indeed, the class diagram in UML does not care about the implementation, and all of its artifacts are at the programming interface level. Although we map UML classes to programming classes, this is a transfer of an abstract abstraction to a concrete abstraction. There is a subtlety that explains the dichotomy between the design domain and the programming domain.
Interfaces also allow you to simulate multiple inheritance when it is not accessible in an inconvenient way. For example, the cat class will implement the cat interface, which inherits from the animal interface. This cat class will also implement these interfaces: walk, run, eat and make sound. This compensates for the lack of multiple inheritance at the class level, but each time you need to redefine everything, and you cannot, at best, consider reality, as reality itself does.
Also in C #, for example, interfaces can compensate for the lack of true universal polymorphism on open types without actually achieving the goal, because you have lost strong typing.
In addition, interfaces are the human representation of virtual tables created by the compiler on the classes you create.
In the end, interfaces are necessary so that incompatible systems can exchange data without worrying about the implementation and management of objects in memory, as was presented in the (distributed) general object model.
What is a class?
Having defined the contraction of reality from an external point of view, you can describe it from an internal point of view: this is a class in which you define data processing and message management to allow your embodied reality to come to life and interact thanks to objects using instances.
Thus, in UML, you implement a fractal immersion in the wheels of a machine and describe states, interactions, etc., in order to be able to implement an abstraction of a fragment of reality that you want to work with.
Thus, the abstract class is somehow equivalent to the interface from the point of view of the compiler.
Additional Information
Protocol (Object Oriented Programming)
C # - Interfaces
C # - Classes
Virtual method table