Learn
That
Stack
Ace your next interview
Tech Stacks
Cheatsheets
Interview Questions
Sign in
Tech Stacks
Cheatsheets
Interview Questions
Sign in
Home
Interview Questions
Java
What are access modifiers in Java?
Back to Java
All Backend Development
Previous
Next
What are access modifiers in Java?
Beginner
Answer
private:
Accessible only within the same class
default (package-private):
Accessible within the same package
protected:
Accessible within same package and subclasses
public:
Accessible from anywhere
Back to Java
Previous Question
Next Question
Explanation
AI Powered
Generating explanation with Claude AI...
This will use 10 credits
credits used
Close
Close