package zy; public class K { public int id; public String name; public int age; public String city;
public String introduce() { return + id + ": 姓名 " + name + ", 年龄" + age + ", 地址" + city ; } }
public class Zaoren { public static void main(String[] args) { K p1=new K(); K p2=new K(); K p3=new K(); K p4=new K();
p1.id=100000; p1.name="A1"; p1.age=19; p1.city="上海"; p2.id=200000; p2.name="A2"; p2.age=18; p2.city="北京"; p3.id=300000; p3.name="A3"; p3.age=19; p3.city="深圳"; p4.id=400000; p4.name="A4"; p4.age=19; p4.city="广州"; System.out.println(p1.introduce()); System.out.println(p2.introduce()); System.out.println(p3.introduce()); System.out.println(p4.introduce()); }
}