代码块(2)

The interface SomeInterface cannot define an initializer

初始化块

 site:docs.oracle.com initializer

http://docs.oracle.com/javase/specs/jls/se8/html/jls-8.html

区别:

Instance initializers are blocks of executable code that may be used to help initialize an instance when it is created.

Static initializers are blocks of executable code that may be used to help initialize a class.

原文地址:https://www.cnblogs.com/zno2/p/4569248.html