title: Change value in boolean array. Choose place not value
body: <p>I'm not sure this is possible. I'm building a program to choose a lotto row. I have a for loop to random pick seven numbers from 1 to 35. My plan is that i can make a boolean array and then take one of the random numbers to choose a place (not a value) in the boolean array and change it to True. </p>
  
  <p>In this way I have the row number and I'm sure that the number is taken when the array place I true. </p>
  
  <pre><code>import java.util.Random; {
  
  
  public static void main(String[] args) {
      int randomNr;
      boolean[] lottoRow = new boolean[35];
  
      Random randNr = new Random();
  
      for(int i=0; i&lt;7; i++) {
          randomNr = randNr.nextInt(35)+1;
  
      }
  }
  </code></pre>
  
  <p>How would i do this? Is it even a good way to approach this problem? </p>