Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In the Controller class main() under the code you wrote in step 2. Create the following arraylists: cars which is an arraylist that holds
In the Controller class main() under the code you wrote in step 2. Create the following arraylists: cars which is an arraylist that holds only Car objects humans which is an arraylist that holds only Human objects fruits which is an arraylist that holds only Fruit objects bowls which is an arraylist that holds only Bowl objects Under these arraylists write the following code: // for mac os BufferedReader br = new BufferedReader (new FileReader("./data/data.txt")); window //BufferedReader br = new BufferedReader (new FileReader(".\data\data.txt")); string line: String strCurrentLine: while ((strcurrentLine = br.readLine()) !=null) { // YOU WRITE CODE HERE HERE WRITE THE CODE THE PARSE ALL THE CARS FROM THE data.txt AND CREATES A NEW CAR INSTANCE WITH THE PARSE DATA THEN ADD THE NEW CAR INSTANCE TO THE cars ARRAYLIST catch (IOException e) { e.printStackTrace();
Step by Step Solution
★★★★★
3.46 Rating (149 Votes )
There are 3 Steps involved in it
Step: 1
java import javautilArrayList public class Main public static void mainString args ArrayL...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started