C
CJ
Hi,
Came across this issue - anyone know why this works?
public class Cat {
private int privateVal;
public void test()
{
Cat c1 = new Cat();
c1.privateVal = 1;
}
}
Surely the "privateVal" variable should not be accessible at this
point (should be out of scope)? Anyone care to enlighten me??
Thanks
CJ
Came across this issue - anyone know why this works?
public class Cat {
private int privateVal;
public void test()
{
Cat c1 = new Cat();
c1.privateVal = 1;
}
}
Surely the "privateVal" variable should not be accessible at this
point (should be out of scope)? Anyone care to enlighten me??
Thanks
CJ