java生成随机数

 1 public class text1 {
 2     // TODO Auto-generated method stub
 3     
 4     public static int Random(int number1,int number2){
 5         return (int) (number1+ Math.random()*(number2-number1));
 6         
 7     }
 8     public static void main(String[] args) {
 9         System.out.println(Random(1,10));
10     }
11 }
View Code
原文地址:https://www.cnblogs.com/dulute/p/10557792.html