Home > Back-end >  Designed for random roll call, great god online solution
Designed for random roll call, great god online solution

Time:10-10

Random roll designed:
1, first create method can store the names of the students into a array;

2, a method can display the student's name; Includes an array of serial number number
3, using the random function to create a method, to obtain a random value (is the student number); By the value of the corresponding student name the student is random order name,
Reference code is as follows, the subsequent code own work
Package cn. Itcast. Lx0310;
import java.util.Scanner;
import java.util.Random;
Public class Randomname {
Public static void main (String [] args) {}
Public static void Addname (String [] stus) {Scanner sc=new Scanner (System. In); for (int i=0; i}
Public static void Displayname (String [] stus) {for (int I=0; i}
}
  • Related