0

I am new to using eclipse and I am totally puzzled as to why it doesn't like the first line of my for loop

public Practice(int n) {
    this.n=n;
    for(int i=0; i<n; i++){
        (int j=0; j<n; j++) {
            this.decay=new double[i][j];
        }
    }
}
3
  • 2
    Are you getting an error message? What is it? Jul 17, 2012 at 22:28
  • 3
    When your code has major syntax errors, Eclipse does have a tendency to sometimes put red cross signs and squiggles somewhere above where the actual syntax error occurs.
    – ryanp
    Jul 17, 2012 at 22:32
  • yeah this is confusing. I had not noticed it before.
    – Magpie
    Jul 17, 2012 at 22:43

2 Answers 2

7

You are missing the for keyword for the second loop. Corrected:

public Practice(int n) {
    this.n=n;
    for(int i=0; i<n; i++){
        for(int j=0; j<n; j++) {
            this.decay=new double[i][j];
        }
    }
}
0
-2

You're using a parenthesis not a curly brace.

Edit - Sorry, didn't look at the way you formatted it.

Not the answer you're looking for? Browse other questions tagged or ask your own question.