Design and implement a class called flight that represents


Design and implement a class called Flight that represents an airline flight. It should contain instance data that represents the airline name (String), flight number (int), and the flight's origin city (String) and destination city (String). Define the Flight constructor to accept and initialize all instance data. Include getter and setter methods for all instance data (note you have to follow get / set method's name convention). Include a toString method that returns a one-line description of the flight. The description should contain the airline name, flight number and from which city to which city the flight goes. For example, if the flight airline name is United Airlines, flight number is 3400, original city is Boston and destination city is New York, the description may look like this - "United Airlines flight 3400 from Boston to New York".

Then create a test class called FlightTest, whose "main" method creates two Flight objects with the same airline name but different flight numbers and origin / destination cities. At the end of this "main" method, display these two flights information.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Design and implement a class called flight that represents
Reference No:- TGS0144171

Expected delivery within 24 Hours