title: Cannot make a static reference to the non-static field contents Java
body: <p>I am not formally a java programmer, but by looking at other answers, you set the the class variables using <code>this.variablename</code>. I used the this keyword, but I still end up with the error message as the title, as indicated below. Here is where I am constructing the class:</p>
  
  <pre><code>public class DataProcess {
      int rows = 252; // there's actually only 252 rows in the new "Nothing.csv"
                      // file
      String[][] contents = new String[rows][7];
      DecimalFormat df = new DecimalFormat("####0.00");
  
      public DataProcess(String filename, String[][] contents) {
          this.contents = contents;
  </code></pre>
  
  <p>And when called in main:</p>
  
  <pre><code>public static void main(String[] args) {
          String filename = "";
          filename = args[0];
  
          DataProcess dp = new DataProcess(filename, contents); &lt;==ERROR HERE
  
          System.out.println(dp.isContiguousWeek("12/30/13", "1/1/14"));
          System.out.println(dp.isContiguousWeek("12/30/04", "1/3/05"));
          System.out.println(dp.isContiguousWeek("1/3/05", "1/5/05"));
          System.out.println(dp.isContiguousWeek("1/7/05", "1/10/05"));
          System.out.println(dp.isContiguousWeek("1/31/05", "2/1/05"));
          System.out.println(dp.isContiguousWeek("4/29/05", "5/2/06"));
  
          System.out.println(dp.find_weeks(contents)); &lt;== ERROR HERE
      }
  </code></pre>