定义一个People类,它包含属性有姓名name和性别sex和年龄age,一个构造方法,用来初始化这三个属性;定义一

2024-11-18 02:42:39
推荐回答(1个)
回答(1):

public Class People{
private String name;
private String sex;
private Int age;
public viod People(String name,String sex,Int age){
this.name = name;
this.sex = sex;
this.age = age;
}

}