首页 > 其他 > 详细

111

时间:2015-06-03 21:47:20      阅读:184      评论:0      收藏:0      [点我收藏+]
public class Human {

	int id;
	String name="";
	int amount;
	
	void work() {
		System.out.println(this.name+" is working...");
		this.amount+=100;
	}
}
 
	public static void main(String[] args) {
		Human zs=new Human();
		zs.name="张三";
		System.out.println(zs.amount);
		zs.work();
		System.out.println(zs.amount);
		
		Human ls=new Human();
		ls.name="李四";
		System.out.println(ls.amount);
		ls.work();
		System.out.println(ls.amount);
	}

 


111

原文:http://my.oschina.net/u/559752/blog/424499

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!