Written by the Fiveable Content Team โข Last updated September 2025
Verified for the 2026 exam
Verified for the 2026 examโขWritten by the Fiveable Content Team โข Last updated September 2025
Definition
In the given code, "Animal" is a class that defines the blueprint for creating objects representing animals. It has instance variables and methods to manage animal species, age, and weight.
Related terms
Instance: An instance is a specific occurrence or realization of an object created using the Animal class.
Inheritance allows one class to inherit properties and behaviors (variables and methods) from another class. For example, creating subclasses like "Dog" and "Cat" that inherit from the "Animal" class.