A Developer Gateway To IT World...

Techie Uncle Software Testing Core Java Java Spring C Programming Operating System HTML 5 Java 8 ES6 Project

concept of instance variables access outside the class with object

//instance variables access outside the class with object

class one
{
    //instance variables
    int a,b;
    boolean c;
    char ch;

    public static void main(String args[])
    {
        one o=new one();
        System.out.println(o.a);//print default value of int because we have not assign the value to a;
        System.out.println(o.b);//print default value of int because we have not assign the value to b;
    }


}



output:












LEARN TUTORIALS

.

.