I am not formally a java programmer, but by looking at other answers, you set the the class variables using this.variablename
. 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:
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;
And when called in main:
public static void main(String[] args) {
String filename = "";
filename = args[0];
DataProcess dp = new DataProcess(filename, contents); <==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)); <== ERROR HERE
}