title: Arrays and nested Loops
body: <p>Question in book:</p>
  
  <p>Write a loop that fills an array values with ten random numbers between 1 and 100. Write code for two nested loops that fill values with ten different random numbers between 1 and 100.</p>
  
  <p>My question: Why does this require a nested loop?</p>
  
  <p>My code: </p>
  
  <pre><code>import java.util.Arrays;
  import java.util.Random;
  
  public class ArrayPractice
  {
      public static void main(String[] args)
      {
          Random random = new Random();
          int[] a = new int[10];
          int i;
  
          for (i = 0; i &lt; 10; i++)
          { 
  
              a[i] = 1 + random.nextInt(100);
  
              System.out.print(a[i]+ " ");
  
      }
  
  }
  </code></pre>