title: Returning Wrong Indexes of Array
body: <p>I'm trying to use <a href="https://stackoverflow.com/questions/11001720/get-only-part-of-an-array-in-java">this</a> to print out only part of an array. My array is 5 elements long - <code>{6, 4, 2, 6, 2}</code> - and I'd like to print just <code>{6, 4, 2, 6, 2}</code>. But using my current code, it's printing out <code>[4, 2, 6, 2]</code> - indexes 1 through 4, not indexes 0 through 3. Why might this be happening?</p>
  
  <pre><code>String nucList = CCATT-AATGATCA-CAGTT
  int[] counter = new int[5];
  for (int i = 0; i &lt; nucList.length(); i++) {
      if (nucList.charAt(i) == 'A') {
      } else if (nucList.charAt(i) == 'C') {
          counter[0]++;
      } else if (nucList.charAt(i) == 'G') {
          counter[1]++;
      } else if (nucList.charAt(i) == 'T') {
          counter[2]++;
      } else if (nucList.charAt(i) == '-') {
          counter[3]++;
      }
  int[] counterNucs = Arrays.copyOfRange(counter, 0,  4);
  filePrint.println("Nuc. Counts: " + Arrays.toString(counterNucs));
  </code></pre>
  
  <p>Thanks!</p>
  
  <p>EDIT: This seems to even be an issue with the arrays in my project that should be printing in full as well. Should I post more of my code?</p>