本文共 231 字,大约阅读时间需要 1 分钟。
class Father{ int assets ; public Father() { this(100); //调用其他的构造方法 } public Father(int assets) { this.assets=assets; //第一个是属性,第二个是参数 System.out.println("我有"+assets); }}
this这个关键字,相当于普通话里的“我”
转载地址:http://pnbsn.baihongyu.com/