java - Constructor and method -
for project have question says newgenerationnumber integer. if argument passed parameter less zero, set generationnumber instance variable zero. otherwise assign newgenerationnumber generationnumber instance variable. i'm confused on how start this. code out private int generationnumber
then made if
if (generationnumber >0) generationnumber = generationnumber
i'm confused if right , if need make else
generationnumber = newgenerationnumber; if (generationnumber < 0) { generationnumber = 0; }
else stays way is
Comments
Post a Comment