title: Variable values not being saved after being updated in for loop
body: <p>I'm trying to use a for loop to update previously declared variables, and within the loop the variable values are updating fine (using the print statement to check). However, after the loop ends, if I check the values with a print statement outside the loop, they are the same as they were before the loop and haven't updated for me to use elsewhere.</p>
  
  <pre><code>public class Intervals {
  
  public static void main(String[] args) {
  
      // Declaring necessary constants
      int MINUTES_IN_DAY = 1440;
      int MINUTES_IN_HOUR = 60;
  
      // Take user inputs for interval start and end times in hours
      Scanner input = new Scanner(System.in);
      System.out.print("Enter the earlier interval's start and end time in 24-hour time format. ");
      int intervalStart1 = input.nextInt();
      int intervalEnd1 = input.nextInt();
      System.out.print("Enter the later interval's start and end time in 24-hour time format. ");
      int intervalStart2 = input.nextInt();
      int intervalEnd2 = input.nextInt();
  
  
      // For-each loop that converts all 24-hour times to minutes after midnight
      int times[] = {intervalStart1, intervalEnd1, intervalStart2, intervalEnd2};
      for (int i: times) {
          i = (i / 100 * MINUTES_IN_HOUR) + (i % 100);
          System.out.println("the interval is " + i);
      }
  
      // ERROR: values from for loop are not being saved, so variable values are not being updated as shown in next print line.
  
      System.out.println(intervalStart1);
  </code></pre>