What is the default scope of a method in Java?

后端 未结 6 1080
清酒与你
清酒与你 2020-11-29 18:13

If I type:

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

what is the default scope of doThis()?

6条回答
  •  渐次进展
    2020-11-29 18:25

    If you are not giving any modifier to your method then as default it will be Default modifier which has scope within package.
    for more info you can refer http://wiki.answers.com/Q/What_is_default_access_specifier_in_Java

提交回复
热议问题