Implementation of random roll call device

The code is as follows:

/** random roll call: * 1 Store name * 2 Preview owner's name * 3 Randomly choose a person's name * / import Java util. Random; Public class demo {public static void main (string [] args) {/ / store the name and store it in the array. / / the array stores the name and the data type of the name, string string [] names = {"Zhang San", "Li Si", "Wang Wu", "Li Lei", "Han Meimei", "Xiao Ming", "Johnson", "Alice"}// Preview: traverse the array and print all names out. Println ("owner's name is:"); for(int i=0;i

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>