YouTip LogoYouTip

Number Random

# Java random() Method [![Image 3: Java Number Class](#)Java Number Class](#) * * * The random() method is used to return a random number, with the range 0.0 <= Math.random() < 1.0. ### Syntax static double random() ### Parameters * This is a default method and does not accept any parameters. ### Return Value This method returns a double value. ## Example public class Test{public static void main(String args[]){System.out.println(Math.random()); System.out.println(Math.random()); }} Compile and run the above program, the output result will be: 0.54440859672670080.7960235983184115 * * Java Number Class](#)
← Docker Image UsageNumber Todegrees β†’