Static data sharing
I always thought that
a object cannot be modified unless u have explicit referece(authority to modify)
but the code below allows me to modify the property effecting all the objects ob the base class i doubt(Though i have no rights to say so)
it obeys OOPs priciples
the code for r4eference
please let me know
class b
{
public static int x=25;
public b()
{
System.out.println("in the super");
}
public void show ()
{
System.out.println(x);
}
}
public class a extends b
{
public a()
{
super();
super.x=36;
super.show();
}
public static void main(String args[])
{
a x = new a();
b b1 = new b();
b1.show();
}
}

