• 0 Posts
  • 1.24K Comments
Joined 2 年前
cake
Cake day: 2023年7月7日

help-circle

  • Generally speaking, in object oriented programming there are ways to derive one class from another. So if you have a Car class, but you decide that it would actually make sense to have a Truck class as well, you can use Car as a starting point, inherit all of its properties, and then just change the specific parts that are different for the Truck class. This saves repeating work, and allows you to build in layers; instead of Car and Truck you might start with a Vehicle class, then derive a GroundVehicle class from that, then a Bike, Car and Truck class from GroundVehicle, and so on.