Computer Science, asked by sinu807, 8 months ago

differentiate between public and private visibility modes in Java​

Answers

Answered by KeshavGiri
7

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. a local variable can only be final in java

Answered by priyaayika
3

Explanation:

The public derivation means that the derived class can access the public and protected members of the base class but not the private members of the base class. private access specifier is used to make any variable or a method which has a limited access with in the class only.

Similar questions