What is the default scope of a method in Java?

后端 未结 6 1079
清酒与你
清酒与你 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:42

    Java 8 now allows implementation of methods inside an interface itself with default scope (and static only).

提交回复
热议问题