--男人类
man = {name = "man",age=123}
--继承空间
man.__index=man
--儿童类
child= {}
--继承
setmetatable(child,man)
print(child.age)
yong= {}
setmetatable(yong,man)
child.age=12
yong.age=16
print("青年年龄:"..yong.age..",儿童团年龄:"..child.age)
print(man.age)
--男人类
man = {name = "man",age=123}
--继承空间
man.__index=man
--儿童类
child= {}
--继承
setmetatable(child,man)
print(child.age)
yong= {}
setmetatable(yong,man)
child.age=12
yong.age=16
print("青年年龄:"..yong.age..",儿童团年龄:"..child.age)
print(man.age)