public class Example{
public static void main(String args[]){
int x = -5;
if(x < 0){
throw new IllegalArgumentException("The number is too small!");
}
System.out.println(x);
}
}
原文:
http://www.cstutoringcenter.com/tutorials/java/java10.php
抛出异常
最新推荐文章于 2024-01-17 17:36:31 发布