IllegalArgumentException: Bound must be positive

版权声明:本人原创,转载需说明文章出处     https://blog.csdn.net/persistencegoing/article/details/88658144

https://blog.csdn.net/persistencegoing/article/details/84376427

  出现这个错是因为你代码参数的原因

比如:

 int x=-1;
int num=new Random().nextInt(x);

x在nextInt方法中    必须大于等于0;

然后就解决了

希望大家关注我一波,防止以后迷路,有需要的可以加群讨论互相学习java ,学习路线探讨,经验分享与java求职     

群号:721 515 304

猜你喜欢

转载自blog.csdn.net/persistencegoing/article/details/88658144