I have had a look for an explanation but haven't been able to find one. Why does this code work? Specifically - why can the private members of an instance be accessed? As far as I know it only works when the instance is created in a method inside the original class.
public class MyClass {
private int thing;
public MyClass () {}
public MyClass makeMe () {
MyClass myClass = new MyClass();
myClass.thing = 1;
return myClass;
}
}