public class Red
{
private int a;
public static int b;
public static void main (
String[] args)
{
Red r1 = new Red (),r2=new Red();
r1.a++;
r1.b++;
System.out.println(r1.a+","+r1.b+","+r2.a+","+r2.b );
}
}
The output i got is
1 ,1,0,1.
why is the r2.b is 1 and also for r2.a is 1??
This means instance can increament the static variable .............