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

Asked 1 years ago, Updated 1 years ago, 81 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.