java - Analyze / Filter all variables without declaring each one? -
Say you have 70 different variable variables, and you want to analyze them all and want to set any one equal to zero to 1,
If for each variable two Let's write statements, can you just write one?
Is there a way to do something like this:
if ("anyInt" == 0) {"thatInt" = 1;} ?
Use the code> int [] then repeat them using one for the loop
int [] nums = new int [70]; // Put all your numbers in the array, that is [0] = 5; <{Whatever to do code}}
Comments
Post a Comment