package java1;
public class People {
public String name;
public int age;
public String sex;
public String height;
People(String name, int age, String sex, String height) {
this.name = name;
this.age = age;
this.sex = sex;
this.height = height;
}
public String shuohua(String hua) {
System.out.println("说:" + hua);
return hua;
}
public double jia(double a, double b) {
System.out.println(a + "+" + b + "=" + (a + b));
return a + b;
}
public String changename(String name) {
this.name=name;
System.out.println("修改后的名字为"+name);
return name;
}
People ren=new People("张三",18,"男",1.80);
System.out.println(ren.name+ren.height+ren.sex+ren.age);
ren.shuohua("你好!");
ren.jia(23,45);
ren.changename("李四");