// Copyright 2005 by Scott T. Leutenegger class Person2 { private var name:String ; private var age:Number ; private var gender:String ; private var ssn:String ; // constructor, NOTE, unlike C++/java, only ONE constructor is allowed function Person2 (newName:String, newAge:Number, newGender:String, newSSN:String) { setName(newName) ; setAge(newAge) ; setGender(newGender) ; setSSN(newSSN) ; } // set methods private function setName(n:String) : Void {this.name = n ;} private function setAge(age:Number) : Void {this.age = age ;} private function setGender(gender:String) : Void {this.gender = gender ;} private function setSSN(ssn:String) : Void {this.ssn = ssn ;} // get methods public function getName() : String {return name ;} public function getAge() : Number {return age ;} public function getGender() : String {return gender ;} public function getSSN() : String {return ssn ;} // print method: prints out the object contents public function print() : Void { trace(this.name + " " + this.age + " " + this.gender + " " + this.ssn) ; } }