-3

Hey all I'm having trouble figuring this out. Just learning java for the first time. Any help would be awesome thanks!

Type two statements using nextInt() to print two random integers between 0 and 9. End with a newline. Ex: 5 7

import java.util.Scanner;

import java.util.Random;

public class DiceRoll {
public static void main (String [] args) {

Random randGen = new Random();

int seedVal = 0;

randGen.setSeed(seedVal);

  `enter code here`/* Your solution goes here  */


return;
   }
}
User11
  • 27
  • 1
  • 1
  • 11
  • 1
    See [here](http://stackoverflow.com/questions/363681/generating-random-integers-in-a-specific-range) – Rao Jan 28 '16 at 02:03

2 Answers2

0

Try this:

int  a = randGen.nextInt(10);
int  b = randGen.nextInt(10);    
System.out.println(a);
System.out.println(b);
Community
  • 1
  • 1
0

I noticed the problem requested you only write two lines. I believe this would get you the exact same results as requested by the problem.

    System.out.println(randGen.nextInt(10));
    System.out.println(randGen.nextInt(10));
Cat
  • 11
  • 3