36. [ ] this.sSex = s.sSex
37. [ ]
38. [-] void getStudent( window s)
39. [ ] s.iAge = this.iAge
40. [ ] s.sName = this.sName
41. [ ] s.sSex = this.sSex
42. [-] void printInfo()
43. [ ] print("{sSex} student {sName} is {iAge} years old")
44. [ ]
[ ] //FileName: People.inc
[ ] //Author: Yuetian Zeng from http://blog.csdn.net/yuetian/
[ ]
[ ]
[ ] // base class
[-] winclass People
[ ] // declare two data members and set default value for them
[ ] string sName = "SilkTest"
[ ] int iAge = 10
[ ]
[ ] // set and get Age
[-] void setAge(int age)
[ ] iAge = age
[-] int getAge()
[ ] return iAge
文章来源于领测软件测试网 https://www.ltesting.net/