public class Person {
private String name;
private String sex;
private int age;
private static Person pp=null;
private Person(){
}
private Person(String name, String sex, int age) {
super();
this.name = name;
this.sex = sex;
this.age = age;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public static Person getperson(){
if(pp==null){
pp=new Person();
}
---------------------------------------
public class Student {
public static void main(String[] args) {
Person pp=Person.getperson();
pp.say();
}
}