Question: I keep getting an error message when I try to compile this code for use for a school project I am trying to do. This

I keep getting an error message when I try to compile this code for use for a school project I am trying to do. This is the error codes:I keep getting an error message when I try to compile this

This is the code itself:

import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; public class FlightList { ArrayList airType = new ArrayList(); ArrayList flts = new ArrayList(); public static void main(String[] args) throws ParseException { FlightList flts = new FlightList(); flts.addAircraftTypes(); flts.addFlights(); flts.printFlights(); } public void addAircraftTypes() { airType.add(new AircraftType("Boeing", "737-800", "B738", EngineType.Jet, 2)); airType.add(new AircraftType("Boeing", "747-400", "B744", EngineType.Jet, 4)); airType.add(new AircraftType("Airbus", "A320", "A320", EngineType.Jet, 2)); airType.add(new AircraftType("Airbus", "A330", "A330", EngineType.Jet, 4)); airType.add(new AircraftType("Embraer", "ERJ-145", "E145", EngineType.Turbofan, 2)); airType.add(new AircraftType("Bombardier", "CRJ-900", "CRJ9", EngineType.Turbofan, 2)); } public void addFlights() throws ParseException { SimpleDateFormat sdf = new SimpleDateFormat("MM-dd-yyyy HH:mm"); flts.add(new Flight("205", "AA", "PHL", "SVO", sdf.parse("1-28-2021 06:00"), sdf.parse("1-28-2021 18:30"), airType.get(0), "B20")); flts.add(new Flight("103", "UA", "SFO", "LAX", sdf.parse("1-28-2021 08:00"), sdf.parse("1-28-2021 10:30"), airType.get(2), "C22")); flts.add(new Flight("999", "DL", "LHR", "JFK", sdf.parse("1-28-2021 12:00"), sdf.parse("1-28-2021 21:00"), airType.get(1), "D10")); flts.add(new Flight("453", "WN", "ATL", "BWI", sdf.parse("1-28-2021 14:00"), sdf.parse("1-28-2021 16:30"), airType.get(5), "A15")); flts.add(new Flight("711", "AS", "SEA", "SAN", sdf.parse("1-28-2021 16:00"), sdf.parse("1-28-2021 18:30"), airType.get(4), "B4")); } public void printFlights() { for (Flight flt : flts) { System.out.println(flt); } } } enum EngineType { Jet, Turbofan, Turbojet } class AircraftType { private final String manufacturer; private final String model; private final String typeCode; private final EngineType engineType; private final int engineNumber; public AircraftType(String manufacturer, String model, String typeCode, EngineType engineType, int engineNumber) { this.manufacturer = manufacturer; this.model = model; this.typeCode = typeCode; this.engineType = engineType; this.engineNumber = engineNumber; } @Override public String toString() { return "A/C " + manufacturer + " " + model + " " + engineType + " " + engineNumber; } }

IJ File Edit View Navigate Code Refactor Build Run Iools VCS Window Help FlightList-FlightList.java IJ File Edit View Navigate Code Refactor Build Run Iools VCS Window Help FlightList-FlightList.java

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!