在Java中,可以使用java.util.Random类或Math.random()方法来生成1到100的随机数,以下是几种常见的方法:方法1:使用java.util.Random类(推荐)Random类提供了更...