Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java random 6 digit number

public static String getRandomNumberString() {
    // It will generate 6 digit random Number.
    // from 0 to 999999
    Random rnd = new Random();
    int number = rnd.nextInt(999999);

    // this will convert any number sequence into 6 character.
    return String.format("%06d", number);
}
Comment

java random 5 digit int

int min = 9999;
int max = 1000;

//Generate random int value from 10000 to 99999
//System.out.println("Random value in int from "+min+" to "+max+ ":");
int random_int = (int)(Math.random() * (max - min + 1) + min);
Comment

PREVIOUS NEXT
Code Example
Java :: java remove numbers from set 
Java :: Caused by: java.sql.SQLSyntaxErrorException: ORA-00904: "EXCEPTION": invalid identifier 
Java :: matrix program 
Java :: 8233*4 
Java :: java lib reference 
Java :: android capture view and animation 
Java :: java jackson optional 
Java :: has 8 digit in number 
Java :: java arraylist copy 
Java :: seekbar thumb position 
Java :: Unrolling java - after 
Java :: create a file in java in user home 
Java :: overwrite confguration value spring 
Java :: https://www.baeldung.com/java-stream-findfirst-vs-findany 
Java :: advantages of iterator in java 
Java :: chipview library android 
Java :: cpp live code 
Java :: spring code in java 
Java :: java how to call getReader twice 
Java :: wrap text in jscrollpane 
Java :: findby(xpath selenium java) 
Java :: x/=y is the same as x=x/y 
Java :: String in Queue 
Java :: hadoop fs get size of directory java 
Java :: Kotlin is like java 
Java :: java sin-1 
Java :: kivy menu bar 
Java :: Duplicate class android.support.v4.os.ResultReceiver$MyRunnable 
Java :: how to make 2 nested loops to count to 100 
Java :: check java variable type using getSimpleName method 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =