java - Please arrays, and loops -
a. how write simpler?
if (fclass[0] == 0 && fclass[1] == 0 && fclass[2] == 0 && fclass[3] == 0 && fclass[4] == 0 && fclass[5] == 0 && fclass[6] == 0 && fclass[7] == 0 && fclass[8] == 0 && fclass[9] == 0 && fclass[10] == 0){ }else{ }
b. solved! how scan array (atm values in @ 0), when change of element set 1 , show ones have 0 still.
example:
if fclass[1], fclass[2], fclass[4], fclass[5], fclass[6], fclass[10], set 1. how program show me fclass[3], fclass[7], fclass[8], , fclass[9]?
thanks help...
for (int f = 0; f <= fclass.length; f++){ if (fclass[f] == 0){ system.out.println(fclass[f]); }
c. teacher requires learn gui doesn't know herself, websites start learning that?
a. can set boolean , loop through them check if zero. i'm assuming fclass variable int[].
boolean flag = true; (int : fclass) { flag &= (i == 0); } if (flag) { // if zero... } else { // if 1 of them not zero... }
b. can loop through array , scan not equal zero.
for (int : fclass) { if (i != 0) system.out.println(i); // these array not equals zero. }
Comments
Post a Comment