Joke Collection Website - Blessing messages - JAVA program, randomly generate a 6-bit verification code (from 0

JAVA program, randomly generate a 6-bit verification code (from 0

Import java.util.random;

Public class TestRandom {

Common string getRandStr(int charCount) {

String charValue =

for(int I = 0; I & ltcharCounti++){

char c =(char)(random nt(0,26)+' a ');

char value+= string . value of(c);

}

Return charValue

}

Common string getRandNum(int charCount) {

String charValue =

for(int I = 0; I & ltcharCounti++){

char c =(char)(random nt(0, 10)+' 0 ');

char value+= string . value of(c);

}

Return charValue

}

public int randomInt(int from,int to){

Random r = new Random();

return from+r . nextint(to-from);

}

}