[ ] // set and get Name
[-] void setName(string name)
[ ] sName = name
[-] string getName()
[ ] return sName
[ ]
[ ] // class Student inherit from People
[-] winclass Student: People
[ ] // declare a new data member and set default value for it
[ ] string sSex = "Male"
[ ] // set and get Sex
[-] void setSex(string sex)
[ ] sSex = sex
[-] string getSex()
[ ] return sSex
[ ]
[ ] // set and get instance
[-] void setStudent(Window s)
[ ] this.iAge = s.iAge
[ ] this.sName = s.sName
[ ] this.sSex = s.sSex
[ ]
[-] void getStudent( window s)
[ ] s.iAge = this.iAge
文章来源于领测软件测试网 https://www.ltesting.net/