摘要: 代码: public class Duixiangtj { private static int n; public Duixiangtj() { n++; } public static int getNum() { return n; } public static void main(Stri 阅读全文
posted @ 2019-10-16 10:49 ziyuliu 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 代码: public class D2 { int age=5; static int a=1; public static void play() { a=2; //age=7; 无法通过编译, 静态方法无法直接访问类的实例成员(即不加static) System.out.println(new 阅读全文
posted @ 2019-10-16 10:31 ziyuliu 阅读(919) 评论(0) 推荐(0) 编辑