我是一个JAVA新手,现在在调用您的 随机数字 浮点数 字符串产生算法,
为什么我这样调用时
RandomStrg RSTR= new RandomStrg();
RSTR.setCharset("a-zA-Z0-9");
RSTR.generateRandomObject(); 《----这一句
RSTR.getRandom();
RSTR.generateRandomObject();这一句,总在报
unreported exception java.lang.Exception; must be caught or declared to be thrown at line 90MM, column 10
public final void generateRandomObject() throws Exception {
// check to see if the object is a SecureRandom object
if (secure) {
try {
// get an instance of a SecureRandom object
if (provider != null)
// search for algorithm in package provider
random = SecureRandom.getInstance(algorithm, provider);
else
random = SecureRandom.getInstance(algorithm);
} catch (NoSuchAlgorithmException ne) {
throw new Exception(ne.getMessage());
} catch (NoSuchProviderException pe) {
throw new Exception(pe.getMessage());
}
} else
random = new Random();
}