chapter 13
This commit is contained in:
9
examples/inheritance.lox
Normal file
9
examples/inheritance.lox
Normal file
@@ -0,0 +1,9 @@
|
||||
class Doughnut {
|
||||
fn cook() {
|
||||
print("Fry until golden brown.");
|
||||
}
|
||||
}
|
||||
|
||||
class BostonCream < Doughnut {}
|
||||
|
||||
BostonCream().cook();
|
Reference in New Issue
Block a user