0

So I'm trying to create a for loops that creates a new value each times it runs. Something like this:

for(int i = 0; i < con.length; i++) {
    Vector max[i] = new Vector(i+1, i+2, i+3);
}

I'm kind of new to java, so i don't understand it very well. Thanks for your help.

4

1 回答 1

1

This should work

Vector[] max = new Vector[con.length];

for(int i = 0; i < con.length; i++) {
    max[i] = new Vector(i+1, i+2, i+3);
}
于 2013-07-29T17:44:59.450 回答