Question: what is the difference between private protected and public in java?
Answer: public means you can access it anywhere while private means you can only access it inside its own class. Just to note all private, protected or public modifier are not applicable to local variables in Java.