When I didn't have any access restrictors for the methods in Java,

Asked 1 years ago, Updated 1 years ago, 95 views

In Java, when the access restrictor for the method is not placed in any of the following ways, the access restrictor Is it public, protected, or private

 void doThis(){
     System.out.println("Hello Stackoverflow.");
 }

java scope

2022-09-21 20:55

1 Answers

In Java, when there is no access restrictor, it is not public or protected private as the default access restrictor Literally the default restrictor. If the access range is default, access is free in the same package It is not accessible from any other packages.


2022-09-21 20:55

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.