Lua表实现类
作者:小教学发布时间:2023-10-04分类:程序开发学习浏览:163
导读:--类Student={name="Holens",age=1,sex=true,Say1=function()print(Stud...
--类
Student = {
name = "Holens",
age = 1,
sex = true,
Say1 = function()
print(Student.name.."说话了")
end,
Say2 = function(t)
print(t.name.."说话了2")
end
}
Student.Say1()
print("*************************************")
--声明后添加
Student.child = "blueman"
print(Student.child)
--lua中.和:区别
--:会默认把调用者 作为第一个参数传入方法
Student:Say2()
print("*************************************")
- 程序开发学习排行
- 最近发表
-
- Minamaze GoDark | WordPress Theme 博客主题下载
- Blogup Diary | WordPress Theme 博客主题下载
- Fire Fighter | WordPress Theme 博客主题下载
- Bosa Construction Company | WordPress Theme 博客主题下载
- Business Networking Conference | WordPress Theme 博客主题下载
- Ecommerce Gadget Store | WordPress Theme 博客主题下载
- MagLink | WordPress Theme 博客主题下载
- The Food Reviewer | WordPress Theme 博客主题下载
- Core Store | WordPress Theme 博客主题下载
- Frutiger Aero | WordPress Theme 博客主题下载