File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 1
1
public class Random {
2
+ public int RandInt () {
3
+ java .util .Random rand = new java .util .Random ();
4
+ return rand .nextInt (90000 ) + 10000 ;
5
+ }
6
+
7
+ public int RandInt (int min , int max ) {
8
+ java .util .Random rand = new java .util .Random ();
9
+ return rand .nextInt (max - min ) + min ;
10
+ }
11
+
12
+ public int RandInt (int seed ) {
13
+ java .util .Random rand = new java .util .Random (seed );
14
+ return rand .nextInt (90000 ) + 10000 ;
15
+ }
16
+
2
17
public static void main (String [] args ) {
3
- System .out .println (new java .util .Random ().nextInt (90000 ) + 10000 + "" );
18
+ Random random = new Random ();
19
+ System .out .println (random .RandInt (1 , 20 ));
20
+ System .out .println (random .RandInt ());
21
+ System .out .println (random .RandInt (123 ));
4
22
}
5
23
}
You can’t perform that action at this time.
0 commit comments