标签:lua ble print 空间 类的继承 int man 男人 meta
--男人类
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)
标签:lua ble print 空间 类的继承 int man 男人 meta
原文地址:http://www.cnblogs.com/ningyongbin/p/6005757.html