If I have a class in C# and I want a variable to be accessible to another class, which is the better way to do it?
1: Use a public static variable.
public static int staticInteger;
2: Use a public static property.
static int staticInteger;
public static int StaticInteger
{
get
{
return staticInteger;
}
set
{
staticInteger = value;
}
}