-
problem
hello,
i need aome help, the code i worte dosn't work and i don't know why...
the code gose like this:
public class RGBImage
{
public RGBImage(int rows, int cols)
{
for (int i = 0 ; i < rows ; i++)
{
for(int j = 0 ; j < cols ; j++)
{
RGBColor[][] pixel = new RGBColor[i][j];//RGBColor class i worte like a week before
}
}
}
public RGBImage (RGBColor pixel[][])
{
for (int i = 0 ; i < pixel.length ; i++)
{
for(int j = 0 ; j < pixel[].length ; j++)//at this point the compiler dosen't work, and i don't know why
{
pixel[i][j] = this.pixel[i][j];
}
}
}
}
why can't i use here in length method? after all its arry...
thankes
-
Re: problem
Please explain what the code does. "doesn't work" is hard to fix without some details.
If you get error messages, copy the full text of the error messages and paste it here.
Please edit your post and wrap your code with
[code=java]
<YOUR CODE HERE>
[/code]
to get highlighting and preserve formatting.