第七次作业

public class T {
	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) {
		// TODO Auto-generated method stub
		T p1=new T();
		T p2=new T();
		T p3=new T();
		T p4=new T();
		p1.id=100000;   p1.name="胸B丶";   p1.age=19;   p1.city="艾欧尼亚";
		p2.id=200000;   p2.name="胸C丶";   p2.age=19;   p2.city="艾欧尼亚";
		p3.id=300000;   p3.name="胸D丶";   p3.age=19;   p3.city="艾欧尼亚";
		p4.id=400000;   p4.name="胸F丶";   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());
	}

}

  

 

posted @ 2017-11-05 15:24  徐丶杨  阅读(90)  评论(0编辑  收藏  举报