Sobes.tech
Middle

Which has a higher level of abstraction: class, abstract class, or interface?

sobes.tech AI

Answer from AI

Interface.

An interface defines a contract, a set of methods without their implementation. It describes the behavior that classes implementing it can have. An abstract class can contain both abstract and implemented methods, as well as fields. It is intended to be used as a base class providing common functionality. A class contains a complete implementation of methods and can have fields, representing a specific type of object with state.

Thus, an interface is at the highest level of abstraction, defining only a contract without implementation details.

Which has a higher level of abstraction: class… - sobes.tech