title: Number Generator with User Input
body: <p>Ok, I have wrote this RandomNumberGenerator.java class and I am getting an error.  Logically it looks like it would work but it is not. I need to have a random number  between the two input's that the user input's. Would someone take a look at my code and see where I am going wrong.  Here is my code:</p>
  
  <pre><code>import java.util.*;
  
  public class NumberGenerator
  {
  
  // Begin 
  
    public static void main(String[] args){
  
  
    Scanner input;
    int max, min, range;
    Random gen;
  
    public static int genRandom(int mod){
      Random r = new Random();
    }
  
  
    input = new Scanner(System.in);
  
    System.out.println("Please enter a max value: ");
    max = input.nextInt();
  
    // Ask user to input max value
  
    System.out.println(" Please enter a minimum value: ");
    min = input.nextInt();
  
    // Ask user to input min value
  
    range = Math.abs(r.nextInt()) % (max - min + 1) + min;
    // Get random integer between min and max values using %
  
  
    System.out.println(" Your generated number is: " + range );
  
    }
  }
  </code></pre>