If I have a nested class, does anything from the owning class exist in the owned class?
for example:
public class OwningClass
{
int randomVariable = 1;
public void MakingMethod()
{
OwnedClass owned = new OwnedClass();
owned.SomeMethod();
}
private class OwnedClass
{
public void SomeMethod()
{
// Is anything from OwningClass available here?
}
}
}
Anything “static” from the owning class is available in your nested class.
If you have an instance of the owning class in some method of the inner class, you may also access its private members.