function People(name,age,sex){
var people_name = "default";
var people_age = 0;
var people_sex = "man";
/*init*/
var init = function(){
people_name=name;
people_age=age;
people_sex=sex;
};init();
/*get*/
this.getName = function(){
return people_name;
};
this.getAge = function(){
return people_age;
};
this.getSex = function(){
return people_sex;
};
/*set*/
this.setName = function(name){
people_name = name;
};
this.setAge = function(age){
people_age = age;
};
this.setSex = function(sex){
people_sex = sex;
};
}
/*****************************************************
var :定义对象的私有属性和私有方法
this. :定义对象的共有属性和共有方法
init函数:模拟类的构造函数
*****************************************************/