I want to know the difference between public default protected private!

Asked 2 years ago, Updated 2 years ago, 92 views

Is there a rule like how to use public default when inheriting classes or interfaces?

java access-modifiers

2022-09-22 15:14

1 Answers

It's about specifying a range of access. You can designate it according to your needs.

Access is this way: public is accessible from anywhere, protected from subclass The default is the package, and the private is only accessible in the class.


2022-09-22 15:14

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.