title: Filling an array with objects from a .txt file?
body: <p>I'm new to Java and am trying to create an array with objects read from a .txt file.
  The file looks something like this</p>
  
  <pre><code>Wall 2 2
  Wall 3 4
  Wall 3 5
  </code></pre>
  
  <p>.... and so on.</p>
  
  <p>What I want to do is use the RandomAccessFile() function to fill an array[8][8] with the objects in the file, and in their appointed positions.
  I've been looking around but can't find a solution, or maybe I'm not looking in the right place.
  Any help will be appreciated. </p>
  
  <p>EDIT:</p>
  
  <p>I've made some progress (I think) and am able to read from the .txt file, however, I can't seem to assign objects to specific locations in my array... 
  This is what I've got</p>
  
  <pre><code>        public static void leer() throws IOException
  {
      Scanner s = new Scanner(new File("init.txt"));
          while (s.hasNext()) 
          {
  
              if (s.next()=="Wall")
              {
              int i = s.nextInt();
              int j = s.nextInt();
              Tablero[i][j]=new Wall();
  
              }
              else if (s.next()=="Ghost")
              {
              int i = s.nextInt();
              int j = s.nextInt();
              Tablero[i][j]=new Ghost();
              }
          }
  }
  </code></pre>
  
  <p>Now, I'm getting a "NoSuchElementException", which I gather means I'm not defining the Walls or Ghosts properly, and sadly, I don't quite understand the enum function...
  Again, any help would be great!</p>