So I have this code :
public static void main (String[] args) throws IOException
{
Queue popcorn = new LinkedList();
BufferedReader in = null;
int j = 0;
try {
File file2 = new File("Events.txt");
in = new BufferedReader(new FileReader(file2));
String str;
String [][] process = new String[][];
while ((str = in.readLine()) != null) {
String[] arr = str.split(" ");
for(int i=0 ; i<str.length() ; i++){
process[j][i] = in.readLine();
}
j++;
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
It doesn't work. It throws "Variable must provide either dimension expressions or an array initializer"
I am trying to model it after this webpage answer " http://www.chegg.com/homework-help/questions-and-answers/hired-biggy-s-popcorn-handle-popcorn-orders-store-write-java-console-application-reads-dat-q7220573 " which i am PRETTY SURE does not work. Anyway this linked list doesn't seem to be working out. Can someone point me in the right direction as far as my String[][] process declaration is concerned?
new String[][]- it is not possible to create an array without dimensions, which is what the message says. This is separate from the variable declaration. Search for error messages for general hints/directions.