static

class Person{
    static int i;
}
class Test{
    public static void main(String args []){
        Person.i=10;
    }
}

 

注意,静态函数中不能直接引用非静态成员变量。

 

posted on 2015-11-25 11:07  凡一二三  阅读(142)  评论(0)    收藏  举报