title: Cannot be resolved to a variable eclipse
body: <p>The code is supposed to read in a line of text from a textfile and process it, add it to an array of processed lines, and return the array</p>
  
  <p>However I keep getting an error when I try to return the array. I assume I've done something wrong in the body of the code</p>
  
  <pre><code>static public Media[] importMedia(String fileName){
          try {
          FileReader fileReader = new FileReader(fileName);
          BufferedReader br = new BufferedReader(fileReader);
          System.out.println("Reading metadata file: "+fileName);
  
          int len=new Integer(br.readLine()); //read number of entries in file
  
          //read line in text file
          //process line using createMedia
          //add media to array of media objects
  
          Media media = createMedia(br.readLine());
          Media[] newMedia = new Media[len];
  
          for(int i = 0;i&lt;=len;i++){
              newMedia[i] = media;
          }
          //return newMedia
          br.close();
      } catch (IOException e){
          System.out.println("IO error reading "+fileName);
  
      }
      return newMedia;
  }
  </code></pre>