Hello everyone at JavaProgrammingForums!
I am brand new to Java and any help regarding this seemingly basic problem that I've encountered would be greatly appreciated. Thanks, in advance!
I'm trying to write an array within the class MyArray which is used in a separate main class.
I'm getting an "illegal start of expression" error at line 5. The arrow indicating where the error lies is pointing to the closing parentheses of the for loop.
I haven't encountered this error until now so i'm really not too sure what to do. Here's the code:
public class MyArray { int i; MyArray () { double array[] = new double[MAX]; for (i=0; i<MAX; i=++) { system.out.println("what number"); double num = Double.parseDouble(in.readLine()); array[i] = num; } } }
Again, thanks in advance,
Sam