I want to understand why the following code throws Null pointer exception.
import java.util.List;
public class Test {
public static void main(String[] args) {
List<String> names = null;
System.out.println("Result is: " + names == null ? null : names.size());
}
}