$V2EX
Solana
Give SOL to Copy Address
使用 SOL 向 waymedev 打赏,数额会 100% 进入 waymedev 的钱包。
 waymedev's recent timeline updates
waymedev
1.05D

waymedev

V2EX member #273003, joined on 2017-12-07 14:59:07 +08:00
Today's activity rank 7848
Per waymedev's settings, the topics list is hidden
Deals info, including closed deals, is not hidden
waymedev's recent replies
Feb 26
Replied to a topic by wlfh2008 推广 [Claude Code] 不玩套路,留言就送$10
HONGMACC-EDB459E8
Jun 16, 2022
Replied to a topic by dramakevinzz 问与答 Java 什么时候用 assert,什么时候用 if
org.springframework.util.Assert

Spring 也封装过一个 assert 。 你点进源码可以看到,它就是为 if 做了一个封装。
区别于 org.junit.Assert 只是在测试代码中使用。

所以不要看到同名的类就感到疑惑,还是要看一下它的内部实现,不过这对第一次实习的朋友来说也不是大问题,以后看的多了就明白了。

至于用 assert 还是 if ,看心情,或者和团队统一,Spring assert 就是 if 的一个封装,不喜欢大段 if 那就大段 assert /doge
支持一下,谢谢
https://b2b.baidu.com 看下百度的爱采购,前两天听朋友说起这个。
JNPJ7PHPKH66 已使用 感谢
支持,必须支持
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2473 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 21ms · UTC 10:09 · PVG 18:09 · LAX 03:09 · JFK 06:09
♥ Do have faith in what you're doing.