Java Random Numbers

CyberLink Multimedia Software

This simple Program will output Random Numbers using Java


Download an eBook today

Java


import java.util.*; 

class RandomNumbers { 

public static void main(String[] args) { 

int counter; 

Random nums = new Random(); 

System.out.println("Random Numbers:");

for (counter = 1; counter <= 5; counter++) {
  
System.out.println(nums.nextInt(100)); } } }


Click here to see this code run





Comments

Popular posts from this blog

Crypto Mining

Multi-tap Keypad Text Entry