T
The Crow
this is instance global variable example (specific to class instance):
public class A
{
public int MyInt= 42;
}
usage = A a = new A(); int i = a.MyInt;
this is static global variable (accesible from all classes in your
application .)
public class A
{
public static int MyInt= 42;
}
usage = int i = A.MyInt;
if u change public access modifier to private, then whether its static or
instance, you can access it only in your class.
public class A
{
public int MyInt= 42;
}
usage = A a = new A(); int i = a.MyInt;
this is static global variable (accesible from all classes in your
application .)
public class A
{
public static int MyInt= 42;
}
usage = int i = A.MyInt;
if u change public access modifier to private, then whether its static or
instance, you can access it only in your class.