Sunday, January 22, 2012

access private variable


    private int x=10;
    private int y=15;
    public void accessPrivateVariable(){
        int res=0;
       
        res =x+y;
        System.out.println(res);
    }


** variable out side any method are called instance variable

No comments:

Post a Comment