title: Calling a variable from constructor in another method in java
body: <p>If I have a constructor that holds a variable. How can I call that variable in another method within the same class?</p>
  
  <p>In my example below, I want the code to return false in the checkBoundaries method if the col is greater that the Columnnum that is in the constructor. </p>
  
  <pre><code>    import java.util.Arrays;
      class MovieSeating 
      {
          private String[][] Seats;
  
          public MovieSeating(int rowNum, int columnNum)
          {
              Seats = new String[rowNum][columnNum];
              for (int r = 0; r &lt; rowNum; r++)
              {
                  for (int c = 0; c &lt; columnNum; c++)
                  {
                      Seats[r][c] = "?.?";
                      System.out.print(Seats[r][c] + " ");
                  }
                  System.out.println("\n");
              }
  
              System.out.println("Seating is empty.");
  
  
  
          }
  
          public boolean checkBoundaries(int row, int col)
          {
              if (col &lt; 0 || row &lt; 0 || col &gt;= columnNumInConstructorParameter)
              {
                  return false;
              }
              else {
                  return true;
              }
          }
  </code></pre>