Data update
This commit is contained in:
parent
4d5544505c
commit
4924dd0264
3073 changed files with 55820 additions and 4408 deletions
17
Task/Inheritance-Single/Rhombus/inheritance-single.rhombus
Normal file
17
Task/Inheritance-Single/Rhombus/inheritance-single.rhombus
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#lang rhombus/static
|
||||
|
||||
class Animal():
|
||||
nonfinal
|
||||
|
||||
class Dog():
|
||||
nonfinal
|
||||
extends Animal
|
||||
|
||||
class Cat():
|
||||
extends Animal
|
||||
|
||||
class Lab():
|
||||
extends Dog
|
||||
|
||||
class Collie():
|
||||
extends Dog
|
||||
36
Task/Inheritance-Single/V-(Vlang)/inheritance-single.v
Normal file
36
Task/Inheritance-Single/V-(Vlang)/inheritance-single.v
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
struct Animal {
|
||||
mut:
|
||||
alive bool
|
||||
}
|
||||
|
||||
struct Dog {
|
||||
Animal
|
||||
mut:
|
||||
obediant bool
|
||||
}
|
||||
|
||||
struct Cat {
|
||||
Animal
|
||||
mut:
|
||||
trained bool
|
||||
}
|
||||
|
||||
struct Lab {
|
||||
Dog
|
||||
mut:
|
||||
color string
|
||||
}
|
||||
|
||||
struct Collie {
|
||||
Dog
|
||||
mut:
|
||||
catches bool
|
||||
}
|
||||
|
||||
fn main() {
|
||||
mut pet := Lab{}
|
||||
pet.alive = true
|
||||
pet.obediant = false
|
||||
pet.color = "black"
|
||||
println(pet)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue