Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java.util.Random.nextInt()

// Java code to demonstrate the working 
// of nextInt() 
import java.util.*; 
public class NextInt1 { 
	public static void main(String[] args) 
	{ 

		// create random object 
		Random ran = new Random(); 

		// generating integer 
		int nxt = ran.nextInt(); 

		// Printing the random Number 
		System.out.println 
		("The Randomly generated integer is : " + nxt); 
	} 
} 
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
5+3 =