Tariel Asked:2020-03-08 09:17:09 +0800 CST2020-03-08 09:17:09 +0800 CST 2020-03-08 09:17:09 +0800 CST 使用 lambda 语法时如何使用自己的描述抛出异常? 772 使用 lambda 语法,最后一个流语句 .orElseThrow(NotFoundException::new); 如何使用这种语法创建具有自己描述的异常?类似于此代码 new NotFoundException("My message"); java 1 个回答 Voted Best Answer not a Programmer 2020-03-08T13:04:33+08:002020-03-08T13:04:33+08:00 .orElseThrow(() -> new NotFoundException("我的消息"))
.orElseThrow(() -> new NotFoundException("我的消息"))