10

 1 package cn.zrjh;
 2   
 3  public class L {
 4   
 5            public int id;
 6           public String name;
 7           public int age;
 8           public String city;
 9          public String introduce() {
10              return  + id +  ":   我是  " + name + ", 芳龄" + age + ", 家住" + city ;
11          }  
12      
13  
14  }
15 
16 17   package cn.zrjh;
18   
19   public class Y {
20   
21       public static void main(String[] args) {
22           L p1=new L();
23           L p2=new L();
24           L p3=new L();
25           L p4=new L();
26          p1.id=100000;   p1.name="马相露";   p1.age=19;   p1.city="418";
27          p2.id=200000;   p2.name="孔宏旭";   p2.age=18;   p2.city="418";
28          p3.id=300000;   p3.name="菜鸡";   p3.age=19;   p3.city="418";
29          p4.id=400000;   p4.name="黄浩然";   p4.age=19;   p4.city="418";
30          System.out.println(p1.introduce());
31          System.out.println(p2.introduce());
32          System.out.println(p3.introduce());
33          System.out.println(p4.introduce());
34  
35      }
36  
37  }

 

posted @ 2017-12-18 14:24  mxl-1  阅读(92)  评论(0编辑  收藏  举报