UML Abstract Class vs Interface

What is the difference between an abstract class and an interface? This tutorial shows you similarities and differences between these two object-oriented programming concepts.

UML Abstract Class

An abstract class can contain abstract attributes and operations. The abstract members do not contain implementation. Unlike an interface, an abstract class can also include non-abstract members with implementation. An abstract class cannot be instantiated.

There is also another difference between the UML interface and UML abstract class. When a UML abstract class represents a class in single-inheritance object-oriented languages (as C# or Java) - a class can be inherited only from one abstract class, but it can implement multiple interfaces.

UML Abstract Class
UML Abstract Class

UML Interface

An interface is a classifier that contains attributes and operations without any implementation details. An interface cannot be instantiated. UML interface can be depicted in the same way as the UML class or using "lollipop" notation.

UML Interface
UML Interface

New Comment

Comment