From the course: Programming Foundations: Object-Oriented Design
Unlock the full course today
Join today to access over 24,100 courses taught by industry experts.
Abstract and concrete classes - Python Tutorial
From the course: Programming Foundations: Object-Oriented Design
Abstract and concrete classes
- We've defined several different types of spaceships for our game. The starfighter, the cargo shuttle - and the warp cruiser. Weeeee. - And all three of those inherit from the same common superclass called spaceship. We'll use those three subclasses to instantiate objects for each specific type of ship but we'll never actually need to instantiate the generic concept of a spaceship. In this case, spaceship can be defined as an abstract class because it exists purely for the sake of being inherited by other classes to provide some shared behavior but an abstract class itself can never be instantiated because it contains at least one abstract method which is a method that's declared with a method signature but not actually implemented in the abstract class. That's deferred to any subclasses that inherit from the abstract class. They're responsible for actually implementing the abstract methods. In uml diagrams we identify spaceship…
Contents
-
-
-
-
-
-
-
-
(Locked)
Identifying inheritance situations4m 55s
-
(Locked)
Using inheritance2m 44s
-
(Locked)
Abstract and concrete classes3m 10s
-
(Locked)
Interfaces4m 15s
-
(Locked)
Aggregation2m 3s
-
(Locked)
Composition1m 45s
-
(Locked)
Challenge: Jukebox class relationships1m 6s
-
(Locked)
Solution: Jukebox class relationships3m 17s
-
(Locked)
-
-
-