inheritance

This commit is contained in:
Andrea Bianchi
2026-04-29 09:54:15 +09:00
parent e8fb1810e3
commit fec15709e7
9 changed files with 110 additions and 0 deletions

38
w9_cars/test.wsd Normal file
View File

@@ -0,0 +1,38 @@
@startuml
class Vehicle {
-img: PImage
+ {abstract} getDescription(): String
+ draw (x: Number, y: Number, size: Number): void
}
class Car {
- passengers: Number
+ constructor (passengers: Number)
+ getDescription (): String
}
class Truck {
- load: Number
+ constructor (load: Number)
+ getDescription (): String
}
class SportCar {
- fullOp: Bolean
+ constructor (fullOptions: Boolean)
+ getDescription (): String
+ getTurbo (): String
+ getOptions (): String
}
class Convertible {
+ constructor()
+ getDescription(): String
+ getRooftop(): String
}
Vehicle <|.. Car
Vehicle <|.. Truck
Car <|-- SportCar
SportCar <|-- Convertible
@enduml