C# ClassesLesson 32Free preview
C# Abstraction
This lesson is part of C# · All levels
Summary
Abstraction hides complexity and only displays essence through abstract classes and abstract methods. An abstract-marked class cannot be made an object, but can be inherited. The abstract method only has a signature and must be filled by each concrete derivative class.
Key points
- Class abstract cannot be instantiated directly with new.
- The abstract method only has a declaration without a body, and it must implement a derivative.
- An abstract class can still contain a standard method that already contains code.
- Abstraction hides the complexity of how it works, while encapsulation hides the details of the data.
- The derivative must override all abstract methods, otherwise a compilation error appears.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.