java技术博客

jsp博客
数据加载中……
java静态成员
/*01*/public class static_demo
/*02*/{
/*03*/    public static int i=0;
/*04*/    public int j=0;
/*05*/    public void show()
/*06*/    {
/*07*/    System.out.println(i);
/*08*/    System.out.println(j);
/*09*/    }

/*10*/}

/*11*/
/*12*/class test
/*13*/{
/*14*/    public static void main(String args[])
/*15*/    {
/*16*/    static_demo obj1=new static_demo();
/*17*/    obj1.i=100;
/*18*/        obj1.j=200;
/*19*/        obj1.show();
/*20*/        static_demo obj2=new static_demo();
/*21*/    obj2.show();
/*22*/    }

/*23*/}

posted on 2008-11-03 14:14 郭兴华 阅读(91) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航: