differentiate between public and private visibility modes in Java
Answers
Answered by
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
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
Social Sciences,
5 months ago
English,
5 months ago
Science,
5 months ago
Art,
10 months ago
Environmental Sciences,
10 months ago
Chemistry,
1 year ago
Science,
1 year ago