October 2014
Beginner to intermediate
285 pages
6h 24m
English
So far, we’ve tended to use the Java keyword public when making static variables and defining functions and plugins. That tells Java that the thing we’re defining should be publicly accessible—all of our own plugin code can use it, and any other plugin in the system can use it as well (like when we use logger).
There is another option. You can create functions or variables or even helper objects that no one else can see. Instead of public, you can make them private.
In programming, there’s a simple rule—so simple it’s the kind of thing you’d tell a five-year-old: don’t expose your privates.
In other words, if you’re using a function or something that only you should use, then mark it as private to ...
Read now
Unlock full access