0
因此,我有一個列表,它們共有空值。我需要排除那些沒有空值的列表。如何從列表中過濾空值以將它傳遞給比較器
所以我是這麼有:
foreignList.stream().filter(c -> c.getForeignBureauInquiryDocSlot() != null);
Collections.sort(foreignList, ((DocumentSorting o1, DocumentSorting o2) -> o1.getForeignBureauInquiryDocSlot() - o2.getForeignBureauInquiryDocSlot()));
但它返回的NullPointerException
列表中的對象類型是什麼? –