为什么
public List<String> getList(){
if (isMyListOKReady())
return myList;
return Collections.emptyList();
}
编译得很好,但是对于
public List<String> getList(){
return isMyListReady() ? myList : Collections.emptyList();
}
日食说"Type mismatch: cannot convert from List<Object> to List<String>"
?