The private keyword is an access modifier used for attributes, methods and constructors, making them only accessible within the declared class .
Read moreWhat is public in Java with example?
The public keyword is an access modifier used for classes, attributes, methods and constructors, making them accessible by any other class .
Read moreWhat does public mean in a method?
When a method is public it means it can be accessed by other objects .15 Nis 2010
Read moreWhat is public and private method in Java?
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 modifiers are not applicable to local variables in Java. a local variable can only be final in java.
Read more