Question: what is the difference between public and private methods 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.