嗨,下面是我的程序,你能告诉我为什么第一个条件没有被执行吗?
package com;
import java.util.ArrayList;
import java.util.List;
public class Test {
public static void main(String args[]) {
List<String> values = null;
String Id = "1234";
if (values != null && Id != null && values.size() > 1
&& !values.contains(Id)) {
// This is never executed
System.out.println("Throw Exception");
} else {
// This is always called
System.out.println("Fine");
}
}
}