title: Reading different data types from a txt file in Java
body: <p>I have a text file that has data of various kinds such as int, String, and (String)ArrayList element. This data has to be passed into the constructor of an object as a parameter however, I am having trouble separating the ArrayList from the txt file.</p>
  <p>The ArrayList can be of size &quot;n&quot; and should be passed into the constructor as an ArrayList.</p>
  <p>The data in the txt file is divided as follows:-</p>
  <pre><code>int, String, int, ArrayListElement; ArrayListElement, int.
  </code></pre>
  <p>As you can see, the elements of the ArrayList are separated by a semicolon meanwhile the other elements are separated by a comma.</p>
  <p>The constructor takes in its parameters as follows:-</p>
  <pre><code>Constructor(int, String, int, ArrayList, int);
  </code></pre>
  <p>Is there any way to do this?</p>