Computer Science, asked by aashnakan112, 5 months ago

Define private and public in Java
What are access modifiers?​

Answers

Answered by surbhisoni9338
0

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.

I hope you are satisfied with my ans

thanks

Answered by cute4752
0

Answer:

The access modifiers in Java specifies the accessibility or scope of a field, method, constructor, or class. ... Private: The access level of a private modifier is only within the class. It cannot be accessed from outside the class. Default: The access level of a default modifier is only within the pac

Similar questions