Solved

# Learning Java TwoRandomTester

Posted on 2008-11-03

Any suggestions that would get this run , I would greatlya appreciated it.

To the expression generator.nextInt(n) will evaluate to a random integer between 0 and 1 less than n inclusive.

Determine which of the two randomly generated integers is the arger of the two and display it to the screen in a message:

"The larger of the number ____ and _____ is ____.

Output

Please enter a number of your choice.

100

The first random number picked was 13.

The second random number picked was 67

The larger of the numbers 13 and 67 was 67

**********************************************

package tworandomtester;

import java.util.Random;

import javax.swing.JOptionPane;

public class TwoRandomTester {

public static void main(String[] args)

{

String input;

Random generator = new Random();

int randNum;

input = JOptionPane.showInputDialog("Please enter a number of your choice");

randNum = generator.nextInt(-1);

JOptionPane.showMessageDialog(null, "The larger of the two numbers si that number");

}

}