Would the following code run?
for (Pixel pix : image.getPixels())
{
pix.setRed(0);
}
pix.setGreen(255);
No, the Pixel variable pix is only usable
inside the for-each loop
- No, we need to write the for-each loop as for (Pixel pix : Picture image)
- Yes, this code would call setGreen() on the last Pixel object in the image.
- Yes, this code would call setGreen() on the first Pixel object in the image.
There are no hints for this question