How can I increment a variable without exceeding a maximum value? How can I increment a variable without exceeding a maximum value? java java