摘要: static(静态)static可以修饰方法,属性,自由块和内部类使用static修饰这些成员,可以理解成与类相关。通过“类名.成员”的形式调用,没有static修饰可以理解这些成员与对象相关,可以通过“对象名.成员”的形式调用注意:static不能用来修饰构造方法 1.static修饰方法 如:m 阅读全文
posted @ 2016-10-14 14:11 IT靖 阅读(249) 评论(0) 推荐(0) 编辑
摘要: this:1.返回调用当前方法的对象的引用。public class Leaf{ private int i=0; public Leaf increament(){ i++; return this;} public static void main(String[] args){ Leaf x= 阅读全文
posted @ 2016-10-13 08:27 IT靖 阅读(141) 评论(0) 推荐(0) 编辑