title: Java - "Cannot Find Symbol" error when calling Arrays.copyOfRange
body: <pre><code>import java.util.*;
  public class DriverExam
  {
      private String[] answers = {"B", "D", "A", "A", "C", "A", "B", "A", "C", "D", "B", "C", "D", "A", "D", "C", "C", "B", "D", "A"};
      private String[] input_validation = {"A", "B", "C", "D"};
      private String[] student_answers = new String[20];
      private int[] missed = new int[20];
      private int[] copy_missed;
      private boolean pass=true;
      private int number_missed = 0;
      Scanner kb = new Scanner(System.in);
      String input;
  
      private String input()
      {
          input = kb.nextLine();
          while(!(input.equalsIgnoreCase("A")||input.equalsIgnoreCase("B")||input.equalsIgnoreCase("C")||input.equalsIgnoreCase("D")))
          {
              System.out.print("Please enter either A, B, C or D: ");
              input = kb.nextLine();
          }
          return input;
      }
  
      public boolean passed(String[] student_answers)
      {
          int v=0;
  
          for(int i=0; i&lt;answers.length; i++)
          {
              if(!(answers[i].equalsIgnoreCase(student_answers[i])))
              {
                  number_missed++;
                  missed[v]=i;
                  v++;
  
              }
  
          }
          if(number_missed&gt;5)
          {
              pass=false;
          }
          return pass;
      }
  
      public String[] setStudentAnswers()
      {
          int question = 1;
          for(int i=0; i&lt;student_answers.length; i++)
          {
              System.out.print("Enter the answer for question "+ question + ": ");
              student_answers[i]=input();
              question++;
          }
  
          return student_answers;
      }
  
      public int totalCorrect()
      {
          int correct = 20 - number_missed;
          return correct;
      }
  
      public int totalIncorrect()
      {
          return number_missed;
      }
  
      public int[] questionsMissed()
      {
          int[] copy_missed = Arrays.copyOfRange(missed, 0, number_missed);   
          return copy_missed;
      }
  
  }
  </code></pre>
  
  <p>More specifically, in the method <code>questionsMissed()</code>, I keep getting <code>cannot find symbol</code> error when it comes to <code>Arrays.copyOfRange</code>.</p>
  
  <p>I have checked the syntax, and I appear to be correct with <code>missed</code> being the <code>int[]</code>, <code>0</code> being the <code>int</code> and <code>number_missed</code> also being an int. </p>
  
  <p>I'm stumped as to why it's not working.</p>