我正在使用这段代码:
for (final String code : Locale.getISOCountries())
{
//stuff here
}
但是在编译时我得到这个错误:
[ERROR] Line 21: No source code is available for type java.util.Locale; did you forget to inherit a required module?
然后是编译器错误的堆栈跟踪。
我在课程开始时做了这两个导入:
package com.me.example;
import java.util.Locale;
import java.util.*;
有什么问题?
在 Netbeans 中,我看到了自动完成选项,并且 Locale 对象没有语法错误......