Abstract class
An abstract class is a class designed as a base for subclasses, providing shared structure or behavior and potentially specifying operations subclasses must implement.
.NET in Action, Second Edition
An abstract class is a C# class that may contain incomplete implementations and cannot be instantiated directly.
- How it is used
- Contrasts abstract classes with interfaces when explaining reusable object-oriented designs and inheritance constraints.
- How deep it goes
- Defines incomplete implementations and instantiation constraints, but stops short of a worked abstract-class implementation.
- What you can do after
- Evaluate whether a shared base class or multiple interfaces better fits an object-oriented design.
Read how .NET in Action, Second Edition explains abstract class →
Practices of the Python Pro
An abstract base class is a class intended to define a common interface or behavior for subclasses and that may prevent direct instantiation until required methods are implemented.
- How it is used
- Defines interface-like contracts that make inheritance and composition more robust.
- How deep it goes
- Explains declaration, enforcement, examples, and signature concerns, but leaves decorators and runtime signature checking largely unexplained.
- Examples
- Uses Predator subclasses and a Command hierarchy to demonstrate required methods and consistent execute signatures.
- What you can do after
- Build it from scratch with Python's abc module, require subclass methods, and refactor command classes around a shared interface.
Read how Practices of the Python Pro explains abstract class →
The Well-Grounded Python Developer: How the pros use Python and Flask
An abstract class is a class intended to define shared structure or behavior without being instantiated directly.
- How it is used
- Structures related classes around shared behavior while supporting specialized child implementations.
- How deep it goes
- Explains inheritance relationships and progressive shape examples, but does not detail abstract-class enforcement mechanisms.
- Examples
- Uses ParentClass and ChildClass listings, then develops Shape, Rectangle, Square, and Circle drawing classes.
- What you can do after
- Apply it via Python inheritance to organize shared attributes and behavior across related classes.
100 C++ Mistakes and How to Avoid Them
An abstract base class is a C++ base class intended to define behavior for derived classes and not to be instantiated directly.
- How it is used
- Defines behavior shared by derived classes without forcing unrelated shapes into a parent-child relationship.
- How deep it goes
- Explains that at least one function must be pure virtual, then illustrates an interface whose functions are all pure virtual.
- Examples
- Uses Shape with Rectangle and Square, contrasting it with Square inheriting Rectangle.
- What you can do after
- Evaluate public inheritance by checking whether derived objects can substitute for base objects and meaningfully implement its behaviors.
Read how 100 C++ Mistakes and How to Avoid Them explains abstract class →
Software Design for Python Programmers
An abstract superclass is a superclass intended to define shared structure or required behavior without being instantiated directly.
- How it is used
- Defines shared behavior and required subclass responsibilities while preventing incomplete superclass instances.
- How deep it goes
- Explains Python implementation, instantiation rules, inheritance, overrides, and a Template Method application.
- Examples
- Uses MotorVehicle with Car and Truck, plus GameReport with baseball and volleyball report subclasses.
- What you can do after
- Build abstract Python hierarchies that share implementation while enforcing subclass-specific methods.
Read how Software Design for Python Programmers explains abstract class →
Essential TypeScript 5, Third Edition
An abstract class is a class that can define shared members while preventing direct instantiation and requiring derived classes to implement designated abstract members.
- How it is used
- Structures shared class behavior while enforcing subclass-specific implementations.
- How deep it goes
- Explains declarations, inheritance, type usage, type guarding, interface reuse, generics, and the compile-time-only runtime restriction.
- Examples
- Uses Person, Employee, Customer, Supplier, AbstractDogOwner, and generic collection subclasses as implementation examples.
- What you can do after
- Build it from scratch by defining shared implementations and abstract requirements for concrete TypeScript subclasses.
Read how Essential TypeScript 5, Third Edition explains abstract class →
Also covered in
- Kotlin in Action, 2E
- Learn C++ by Example
- Crack Any Codebase with AIIn early access (MEAP)
- Python Workout: 50 ten-minute exercises
- Python Workout, Second Edition
- Python How-To
- 100 Java Mistakes and How to Avoid Them
- Object-Oriented Software Design in C++
- Build an AI Agent (From Scratch)
What to know first
- inheritanceInheritance is a mechanism in which a derived type or descendant element receives properties or behavior from a parent, subject to rules that may allow specialization or overriding.
- classA class is a programming-language construct that defines a type’s structure and behavior and provides a basis for creating or representing objects.
- objectAn object is a distinct entity represented or manipulated within a computational system, typically as a value, data structure, resource, or instance of a type.
- superclassA superclass is a class from which another class inherits members, structure, or behavior.
Related concepts
- interfacecontrasts with · An interface is a contract or boundary that specifies the operations, members, or data shape a type or component exposes, without prescribing its complete implementation.
- classkind of · A class is a programming-language construct that defines a type’s structure and behavior and provides a basis for creating or representing objects.
- contractincludes · A contract is an agreed specification of the conditions, expectations, rights, or obligations that govern behavior or interactions between parties or software components.
Questions about abstract class
What is abstract class?
An abstract class is a class designed as a base for subclasses, providing shared structure or behavior and potentially specifying operations subclasses must implement.
Which Manning books explain abstract class?
.NET in Action, Second Edition, Practices of the Python Pro, The Well-Grounded Python Developer: How the pros use Python and Flask, 100 C++ Mistakes and How to Avoid Them, Software Design for Python Programmers and Essential TypeScript 5, Third Edition.
What should I know before learning abstract class?
Manning books that teach abstract class usually introduce inheritance, class, object and superclass first.
What is the difference between abstract class and interface?
An abstract class is a class designed as a base for subclasses, providing shared structure or behavior and potentially specifying operations subclasses must implement. An interface is a contract or boundary that specifies the operations, members, or data shape a type or component exposes, without prescribing its complete implementation.
What kinds of abstract class are there?
Kinds of abstract class include AbstractRepositoryEventListener and contract.
What is abstract class a kind of?
Abstract class is a kind of class. A class is a programming-language construct that defines a type’s structure and behavior and provides a basis for creating or representing objects.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.





