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

Asked 2 years ago, Updated 2 years ago, 109 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.