title: Access to non-static variable from static context
body: <p>I am trying to access a boolean variable <code>stay</code> from my class <code>MontyHall</code> but cannot because it is non-static and i am trying to access it in a static context
  Here is the code:</p>
  
  <pre><code>public void updateStatistics(Door door1, Door door2, Door door3)
  {
      this.numGames = this.numGames + 1;
      oneDoor(door1, 0);
      oneDoor(door2, 1);
      oneDoor(door3, 2);
  
      if (MontyHall.stay == true){
          this.numStay = this.numStay + 1;
      }
      else{
          this.numSwitch = this.numSwitch + 1;
      }
  }
  </code></pre>
  
  <p>The variable stay is located in class <code>MontyHall</code>. Any help would be greatly appreciated as I am very confused how to fix this
  Properties of class <code>MontyHall</code>:  </p>
  
  <pre><code>public class MontyHall {
    boolean stay;
    Door A = new Door("A");
    Door B = new Door("B");
    Door C = new Door("C");
  
    public MontyHall(Door a, Door b, Door c){
      this.A = a;
      this.B = b;
      this.C = c;
    }}
  </code></pre>