I have the code int index, r, g, b;
and I want to set all of them equal to a certain number, I don't individually want to write index = 0; r = 0;
... and so on.
How do I do this in java?
index,r,g,b = 0;
doesn't work for me.
I have the code int index, r, g, b;
and I want to set all of them equal to a certain number, I don't individually want to write index = 0; r = 0;
... and so on.
How do I do this in java?
index,r,g,b = 0;
doesn't work for me.
use this line of code for initializing all the variables at once
r = g = b = index = 0;
or else initialize when you declare like:
int index=0, r=0, g=0, b=0;
Initialize all the values, then set the values.
int index, r, g, b;
index = r = g = b = 0;