码迷,mamicode.com
首页 > 其他好文 > 详细

111

时间:2015-06-03 21:49:00      阅读:123      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!