Question: URGENT! CODE IN JAVA! A flight is characterized by company, departure date, arrival date, departure airport, arrival airport. In main method add 3 flights to
URGENT! CODE IN JAVA!
A flight is characterized by company, departure date, arrival date, departure airport, arrival airport. In main method add 3 flights to a LinkedList, then add them to a HashSet (duplicate flights should be removed automatically) then add them to a TreeSet. Implement class Flight (with all required methods!) and main method. Implement a FlightRepository class that manages a collection of flights. Class should have methods for adding new flights, getting a flight (or a flight collection) company, departure date, arrival date, departure airport, arrival airport . Implement a method that returns a flight/ flight collection based on more than one field. Also implement FlightRepositoryI interface that exposes the methods in FlightRepository. Implement an AirController thread that continuously adds flights in a FlightQueue and an Airport thread that continuously removes flights from the FlightQueue and outputs details for each landed flight. Use producer-consumer pattern. Use explicit locks. Do not use blocking queues or other concurrent collections.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
