不挂科搜题免费

问题:

请编写代码定义一个公共类People人,其中包含三个成员变量,分别是字符串类型的name姓名,整型的

答案:

public class People{ private String name; private int age; private String sex; public People(String name, int age, String sex){ this.name=name; this.age=age; this.sex=sex; } }