19. [ ] print(stu1.sSex)
20. [ ] print("------------------------")
21. [ ]
22. [ ] // initialize stu2
23. [ ] stu2.setStudent(stu1)
24. [ ] // pirnt stu2 data members
25. [ ] print (stu2.getAge())
26. [ ] print(stu2.getName())
27. [ ] print(stu2.getSex())
28. [ ] print("------------------------")
29. [ ]
30. [ ] // change stu2
31. [ ] stu2.iAge = 20
32. [ ] stu2.sName = "Jane"
33. [ ] stu2.sSex = "Female"
34. [ ]
35. [ ] // initialize stu3 from stu2
36. [ ] stu2.getStudent(stu3)
37. [ ] // pirnt stu3 data members
38. [ ] stu3.printInfo()
[ ] //FileName: TestStudent.t
[ ] //Author: Yuetian Zeng from http://blog.csdn.net/yuetian/
[ ]
[ ] use "People.inc"
文章来源于领测软件测试网 https://www.ltesting.net/