java
Wakasa Rumi
You can't judge a book by its cover.
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
throws和try catch什么时候使用
出现异常后,要么抛throws 要么 try catch thrwos 。 是抛给了你的上一级(调用者)。这个异常我处理不了或者不知道怎么处理时使用。 try catch代码块 。是自己处理异常,不用再抛出去,因为自己都能处理的异常抛出去没意义了。 例子:下面代码1/0会抛出ArithmeticException ,被catch语句捕获并进行处理,所以不需要再在方法头再throws异常。 public void test() { // throws ArithmeticException原创 2022-03-28 20:40:51 · 894 阅读 · 0 评论 -
JAVA StringUtils需要导入的依赖
<!-- https://mvnrepository.com/artifact/commons-lang/commons-lang --> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.6</version> </dependency>原创 2020-11-28 11:18:44 · 1395 阅读 · 0 评论
分享