title: Java split and add elements into corrsponding data type arraylists
body: <p>My problem is when a user enters text it should have two elements to split when using .split() however with the items it splits how do I put them into different lists so that I can use integer based list to make calculations.</p>
  
  <p>e.g.
  a user enters "skyrim , 100" the 'skyrim' entry is a string however with the number (integer) '100' I want to split it removing the comma and add it to a ArrayList for calculations and with other inputs added.</p>
  
  <p>game name(String) , hours(integers) &lt;- template</p>
  
  <ol>
  <li>skyrim , 100</li>
  <li>oblivion , 25</li>
  <li>GTA V , 50</li>
  </ol>
  
  <p>so the listed items above are user input with 2 arguments separated by a comma, which will be split, then I need to add them to different arraylists.</p>
  
  <pre><code>Scanner input = new Scanner(System.in);
  
  Arraylist&lt;String&gt; game = new Arraylist&lt;&gt;();
  Arraylist&lt;Integer&gt; hours = new Arraylist&lt;&gt;();
  Arraylist&lt;Object&gt; allGameData = new Arraylist&lt;&gt;();
  
  String gameEntry = input.nextLine().split(" , ");
  
  allGameData.add(gameEntry);
  
  foreach(object items : allGameData) { 
  System.out.println(items);
  }
  </code></pre>
  
  <p>so from here I should have:</p>
  
  <p>skyrim , 100 , oblivion, 25, GTAV , 50</p>
  
  <p>How do i put the game names into the game list and the numbers into the hours list? </p>