title: How to handle aliases for String arrays
body: <p>With the following code, I was wondering how to iterate through one String array, list2, <strong>after</strong> assigning it an alias of list, while changing the elements of list3 <strong>without</strong> changing the elements of list2:</p>
  
  <pre><code>public class Sample {
      public static void main(String[] args) {
          String[] list = {"Hello", "Yay", "Okay", "Hungry", "Wheeee"};
          String[] list2 = list;
          String[] list3 = list;
  
          for (int i = 0; i &lt; list2.length; i++) {
              if (i % 2 == 0) {
                  list3[i] = "X";
              }
          }
  
          for (int i = 0; i &lt; list2.length; i++) {
              System.out.println(list2[i]);
          }
  
          for (int i = 0; i &lt; list3.length; i++) {
              System.out.println(list3[i]);
          }
      }
  }
  </code></pre>
  
  <p>It would output the following when I would want only the elements of list3 to be marked with the Xs:</p>
  
  <pre><code>X
  Yay
  X
  Hungry
  X
  X
  Yay
  X
  Hungry
  X
  </code></pre>
  
  <p>Thanks!</p>