final String[] codes = {"G22", "K13", "I30", "S20"};
final String usercode ="K13";
if (Arrays.asList(codes).contains(usercode))
{
}
List<String> stooges = Arrays.asList("Larry", "Moe", "Curly");
该方法提供 创建一个固定大小,并且已初始化几个元素的List。
http://stackoverflow.com/questions/1128723/in-java-how-can-i-test-if-an-array-contains-a-certain-value