0

If I have an inner class that is private, what should the access modifiers on my variables be in that class?

Should I also make them private?

For example:

private class MyClass {
  public String name; // what would this do?

}

In the above example, since the class is private, but the variable name is public, who has access to it?

Kingamere
  • 9,496
  • 23
  • 71
  • 110

0 Answers0