public class Application {
public static void main(String[] args) {
final class Constants {
public static String name = "globe";
}
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
System.out.println(Constants.name);
}
});
thread.start();
}
}
编译错误:The field name cannot be declared static in a non-static inner type, unless initialized with a constant expression
解决这个问题?