摘要: 1 class Person { 2 private String name; 3 private int age; 4 public void setName(String name) { 5 this.name=name; 6 } 7 public void setAge(int age) { 8 this.age=age; 9 }10 public String getName(){11 return name;12 }13 public int getAge(){1... 阅读全文
posted @ 2013-04-01 20:28 glt66 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 1 public class Cat 2 { 3 private static int sid=0; 4 private String name; 5 int id; 6 Cat(String name) 7 { 8 this.name=name; 9 id=sid++;10 } 11 public void info()12 {13 System.out.println(id);14 }15 public static void main(Stri... 阅读全文
posted @ 2013-04-01 15:54 glt66 阅读(113) 评论(0) 推荐(0) 编辑