Random Numbers Generator
/* This program generates random numbers between 0 and 65535.*/ import java.util.Random; import java.io.*; public class RandomNumbersGenerator { static int p; public static void main (String[] args) { read_keyboard(); RandomNumbersGenerator generator=new RandomNumbersGenerator(); } public static void read_keyboard(){ BufferedReader keyboard; try{ keyboard=new BufferedReader(new InputStreamReader(System.in),1); System.out.println("how many random numbers you want to generate:"); String s=keyboard.readLine(); p=Integer.parseInt(s); System.out.println("It will be generated "+p+" "+"random numbers between 0 and 65535 "); }catch(IOException e){ System.out.println("error while reading from keyboard.Sorry..."); } catch(NumberFormatException e1){System.out.println("Oh,for Heaven's sake!Give me a number!"); } } public RandomNumbersGenerator() { Random random_generator=new Random(); int[] random_numbers_array=new int[p]; for(int counter=0;counter