는필드는 정적 일 수 없습니까? 단지 마지막 필드는 다음과 같습니다
public class DoIt {
public static void main(String[] args) {
final class Apple {
public static String place = "doIt";
}
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
System.out.println(Constants.place);
}
});
thread.start();
}
}
오류 -이 The field name cannot be declared static in a non-static inner type, unless initialized with a constant expression
Constants.place 란 무엇입니까? 코드에서 Apple 클래스를 어떻게 사용합니까? – arjacsoh
가능한 오류 : [오류 : 필드 이름을 정적으로 선언 할 수 없습니다] (http://stackoverflow.com/questions/18526099/error-field-name-cannot-be-declared-static) –