Scanner Keyboard Input

1, first obtaining the keyboard input to create an object Scanner sc = new Scanner (System.in), then use a variable int a = sc.nextInt (); can get a

2, random number generation method Random r = new Random (9); the actual range is 0-8

 

Guess you like

Origin www.cnblogs.com/9797ch/p/11128613.html