Błąd: nazwa pola nie może być deklarowana jako statyczna

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();
    }
}

Błąd kompilacji:The field name cannot be declared static in a non-static inner type, unless initialized with a constant expression

Rozwiązanie tego?

questionAnswers(2)

yourAnswerToTheQuestion