I have a code int index, r, g, b;, and I want all of them to be equal to a certain number, I donβt want to write index = 0; r = 0;... and so on.
int index, r, g, b;
index = 0; r = 0;
How to do this in java? index,r,g,b = 0;not working for me.
index,r,g,b = 0;
use this line of code to initialize all variables at once
r = g = b = index = 0;
otherwise initialize when you declare:
int index=0, r=0, g=0, b=0;
Initialize all values, then set the values.
int index, r, g, b; index = r = g = b = 0;