top of page

Access Modifiers in Java

Writer's picture: Div PatelDiv Patel

Java uses access modifiers to determine which parts of the code can be accessible to any other part of the code or any user or members. This provides increased security to sensitive code.


There are 4 access modifiers in java:

  1. Public

  2. Protected

  3. Default

  4. Private


Here is a chart that shows the difference between these access modifiers:


 
 
 

Recent Posts

See All

Comments


bottom of page