Java Access Modifiers

  • Everything inside “.pde” files are concatenated as 1 “.java” file before compilation.
  • Also they’re wrapped up as 1 PApplet subclass.
  • B/c everything is a member of that 1 class, nothing is actually private among them.
  • So it’s pretty much moot declaring those members w/ private or protected.
  • However, if any “.pde” member happens to be accessed outside its PApplet subclass, its access level kicks in.
  • If you really wish to have access levels on your classes, you’re gonna need to place them on a separate “.java” file, then import them inside a “.pde” file.
1 Like