java 生成12位随机数,解决The literal 9999999999999 of type int is out of range 问题

原本想这样产生一个随机数,但是你会看到,只要数字超过了9位数,就会出问题,提示“The literal 1000000000000 of type int is out of range”

解决方式是把数字转换成long型,在数字后面加上L,代表long型

原文地址:https://www.cnblogs.com/chongyou/p/7773606.html