title: Reading file to arraylist with multiple data type
body: <p>I have a problem with reading from a text file to an arraylist. The problem is that i don't know how to read in multiple types, because in my arraylist there are Points, Strings, booleans, therefor linesplit doesn't work. I checked all the topics and didn't find a solution to this.</p>
  
  <p>edit: Elrendezes class looks like</p>
  
  <pre><code>  class Elrendezes {
     protected Point Po;
     protected String hely;
     protected String foglalo;
     protected boolean foglalt;
    }
  </code></pre>
  
  <p>Here's how my file looks like: </p>
  
  <pre><code> java.awt.Point[x=16,y=13], 1, name1, false
  </code></pre>
  
  <p>And the method to read is</p>
  
  <pre><code>public static ArrayList&lt;Elrendezes&gt; readDataFromFile(){
        ArrayList&lt;Elrendezes&gt; ElrList = new ArrayList&lt;Elrendezes&gt;();
        FileInputStream fstream = null;
        try
        {
            fstream = new FileInputStream("src/files/DataFile.txt");
            BufferedReader br = new BufferedReader(new InputStreamReader(fstream));
            String strLine = null ;
            String tokens[] = strLine.split(", ");
  
  
            while ((strLine = br.readLine()) != null)   {
             tokens = strLine.split(", ");
            // THIS DOES NOT WORK: ElrList.add(new Elrendezes(tokens[0], tokens[1], tokens[2], tokens[3]));
            }
        }
        catch (IOException e) {
          e.printStackTrace();
        }
        finally {
            try { fstream.close(); } catch ( Exception ignore ) {}
        }
        return ElrList;
  
  }
  </code></pre>