Question: How do I take string data stored in an ArrayList and send it to a method with multiple data types in Java. the String data

How do I take string data stored in an ArrayList and send it to a method with multiple data types in Java. the String data in the Array List is stored in this format:

11 14 2016 0 0 0 NY 0 Yes 01 23 2017 1 1 1 IL 1 Yes 04 06 2016 2 2 2 OH 0 Yes 11 14 2017 3 3 3 TX 1 Yes 10 16 2017 4 4 2 NY 0 Yes 09 05 2016 5 5 4 NC 0 Yes 02 25 2018 4 6 5 AL 0 Yes 10 07 2015 1 7 6 NY 1 Yes 08 29 2018 6 8 7 IA 0 Yes

and the method will take elements 1 through 6 and 8 as an intergers, and elements 7 and 9 as Strings for it's parameter. I'm using the split method to break up the data and then send it to the method and this method will create an object with all 9 elements of the data.

I also need to skip to the next object in the ArrayList if the data can't be parsed to an interger or string

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!