E.g:
Person result = persons.stream()
.filter(x -> {
if ("test".equals(x.getName() ) ) {
throw new IOException("not possible inside stream y ?"); //any checked exception
}
//code here
})
我正在寻找原因,为什么即使声明代码的方法抛出IOException,它也不被允许?