SlideShare a Scribd company logo
1 of 3
Download to read offline
Java programing please help me. Hello, I tried making a Class Flight.
Write a Class called Flight that has four member data items:
number - the Flight Number, an integer
destination - The Flight's Destination, a string
status - the Status of the Flight, a char
(B=Boarding, D=Departed, L=Landed, O=Out of Service)
passengerList - The flight's list of passengers. ArrayList
Write the constructor for initializing an object with an inital flight number,
destination, initial status = Boarding, and the passengerList instantiated
but empty
Write get methods for each Data member.
Write set methods for destination and status.
write an addPasssenger method.
Write a clearPassengers method.
Write an equals member method to compare two Flight objects,
and return true if their destinations are equal to each other, otherwise
it returns false.
Write a toString method that will display the values of the member data.
Solution
Flight.java
import java.util.ArrayList;
public class Flight {
private int number;
private String destination;
private char status;
ArrayList passengerList ;
public Flight(int number, String destination){
this.number = number;
this.destination = destination;
status = 'B';
passengerList = new ArrayList();
}
public String getDestination() {
return destination;
}
public void setDestination(String destination) {
this.destination = destination;
}
public char getStatus() {
return status;
}
public void setStatus(char status) {
this.status = status;
}
public int getNumber() {
return number;
}
public void addPasssenger(String passenger){
passengerList.add(passenger);
}
public void clearPassengers(){
passengerList.clear();
}
public boolean equals(Flight f){
if(this.destination.equals(f.destination)){
return true;
}
else{
return false;
}
}
public String toString(){
return "Number: "+getNumber()+" Destination: "+getDestination()+" Status:
"+getStatus();
}
}

More Related Content

More from arjunanenterprises

Describe how a selectively permeable membrane is involved in osmosis.pdf
Describe how a selectively permeable membrane is involved in osmosis.pdfDescribe how a selectively permeable membrane is involved in osmosis.pdf
Describe how a selectively permeable membrane is involved in osmosis.pdfarjunanenterprises
 
Compare and contrast Eriksons fifth stage of personality developme.pdf
Compare and contrast Eriksons fifth stage of personality developme.pdfCompare and contrast Eriksons fifth stage of personality developme.pdf
Compare and contrast Eriksons fifth stage of personality developme.pdfarjunanenterprises
 
Briefly describe the phenomenon of exon shuffling and provide an exa.pdf
Briefly describe the phenomenon of exon shuffling and provide an exa.pdfBriefly describe the phenomenon of exon shuffling and provide an exa.pdf
Briefly describe the phenomenon of exon shuffling and provide an exa.pdfarjunanenterprises
 
Biological Science in the Newsdentify source (internet link) and d.pdf
Biological Science in the Newsdentify source (internet link) and d.pdfBiological Science in the Newsdentify source (internet link) and d.pdf
Biological Science in the Newsdentify source (internet link) and d.pdfarjunanenterprises
 
An organization called the Repository for Germinal choice in Escondid.pdf
An organization called the Repository for Germinal choice in Escondid.pdfAn organization called the Repository for Germinal choice in Escondid.pdf
An organization called the Repository for Germinal choice in Escondid.pdfarjunanenterprises
 
XYZ stock price and dividend history are as follows Year Beginning-.pdf
XYZ stock price and dividend history are as follows Year Beginning-.pdfXYZ stock price and dividend history are as follows Year Beginning-.pdf
XYZ stock price and dividend history are as follows Year Beginning-.pdfarjunanenterprises
 
a- Define public goods and common resources. How are they similar an.pdf
a- Define public goods and common resources. How are they similar an.pdfa- Define public goods and common resources. How are they similar an.pdf
a- Define public goods and common resources. How are they similar an.pdfarjunanenterprises
 
A fin may be manufactured as an integral part of a surface by using .pdf
A fin may be manufactured as an integral part of a surface by using .pdfA fin may be manufactured as an integral part of a surface by using .pdf
A fin may be manufactured as an integral part of a surface by using .pdfarjunanenterprises
 
Which of the following statements is false Financial accounting mus.pdf
Which of the following statements is false Financial accounting mus.pdfWhich of the following statements is false Financial accounting mus.pdf
Which of the following statements is false Financial accounting mus.pdfarjunanenterprises
 
What does IPO underpricing refer to When in recent decades has it b.pdf
What does IPO underpricing refer to When in recent decades has it b.pdfWhat does IPO underpricing refer to When in recent decades has it b.pdf
What does IPO underpricing refer to When in recent decades has it b.pdfarjunanenterprises
 
When summing forces in the x direction why does Force of Ax be i.pdf
When summing forces in the x direction why does Force of Ax be i.pdfWhen summing forces in the x direction why does Force of Ax be i.pdf
When summing forces in the x direction why does Force of Ax be i.pdfarjunanenterprises
 
Which of the following statements true about Cyanobacteria Cyanobact.pdf
Which of the following statements true about Cyanobacteria Cyanobact.pdfWhich of the following statements true about Cyanobacteria Cyanobact.pdf
Which of the following statements true about Cyanobacteria Cyanobact.pdfarjunanenterprises
 
What is the temperature requited to denature myoglobin without guani.pdf
What is the temperature requited to denature myoglobin without guani.pdfWhat is the temperature requited to denature myoglobin without guani.pdf
What is the temperature requited to denature myoglobin without guani.pdfarjunanenterprises
 
Which agency monitors al Confirmed cases of food-borne illnes FDA. C.pdf
Which agency monitors al Confirmed cases of food-borne illnes FDA. C.pdfWhich agency monitors al Confirmed cases of food-borne illnes FDA. C.pdf
Which agency monitors al Confirmed cases of food-borne illnes FDA. C.pdfarjunanenterprises
 
What role does ethics play in leadership Do you believe that some p.pdf
What role does ethics play in leadership Do you believe that some p.pdfWhat role does ethics play in leadership Do you believe that some p.pdf
What role does ethics play in leadership Do you believe that some p.pdfarjunanenterprises
 
What is Simmonds’ disease aka pituitary cachexia Describe the featu.pdf
What is Simmonds’ disease aka pituitary cachexia Describe the featu.pdfWhat is Simmonds’ disease aka pituitary cachexia Describe the featu.pdf
What is Simmonds’ disease aka pituitary cachexia Describe the featu.pdfarjunanenterprises
 
6. All plants produce __________ by mitosis and __________ by meiosi.pdf
6. All plants produce __________ by mitosis and __________ by meiosi.pdf6. All plants produce __________ by mitosis and __________ by meiosi.pdf
6. All plants produce __________ by mitosis and __________ by meiosi.pdfarjunanenterprises
 
What is the pH of a solution that is formed at 25C by combining 300 .pdf
What is the pH of a solution that is formed at 25C by combining 300 .pdfWhat is the pH of a solution that is formed at 25C by combining 300 .pdf
What is the pH of a solution that is formed at 25C by combining 300 .pdfarjunanenterprises
 
ulsalullailut Ul glucose linked to muctose. Similarly, link ing three.pdf
ulsalullailut Ul glucose linked to muctose. Similarly, link ing three.pdfulsalullailut Ul glucose linked to muctose. Similarly, link ing three.pdf
ulsalullailut Ul glucose linked to muctose. Similarly, link ing three.pdfarjunanenterprises
 
This is a photograph of an organelle found in living cells. Use it to.pdf
This is a photograph of an organelle found in living cells. Use it to.pdfThis is a photograph of an organelle found in living cells. Use it to.pdf
This is a photograph of an organelle found in living cells. Use it to.pdfarjunanenterprises
 

More from arjunanenterprises (20)

Describe how a selectively permeable membrane is involved in osmosis.pdf
Describe how a selectively permeable membrane is involved in osmosis.pdfDescribe how a selectively permeable membrane is involved in osmosis.pdf
Describe how a selectively permeable membrane is involved in osmosis.pdf
 
Compare and contrast Eriksons fifth stage of personality developme.pdf
Compare and contrast Eriksons fifth stage of personality developme.pdfCompare and contrast Eriksons fifth stage of personality developme.pdf
Compare and contrast Eriksons fifth stage of personality developme.pdf
 
Briefly describe the phenomenon of exon shuffling and provide an exa.pdf
Briefly describe the phenomenon of exon shuffling and provide an exa.pdfBriefly describe the phenomenon of exon shuffling and provide an exa.pdf
Briefly describe the phenomenon of exon shuffling and provide an exa.pdf
 
Biological Science in the Newsdentify source (internet link) and d.pdf
Biological Science in the Newsdentify source (internet link) and d.pdfBiological Science in the Newsdentify source (internet link) and d.pdf
Biological Science in the Newsdentify source (internet link) and d.pdf
 
An organization called the Repository for Germinal choice in Escondid.pdf
An organization called the Repository for Germinal choice in Escondid.pdfAn organization called the Repository for Germinal choice in Escondid.pdf
An organization called the Repository for Germinal choice in Escondid.pdf
 
XYZ stock price and dividend history are as follows Year Beginning-.pdf
XYZ stock price and dividend history are as follows Year Beginning-.pdfXYZ stock price and dividend history are as follows Year Beginning-.pdf
XYZ stock price and dividend history are as follows Year Beginning-.pdf
 
a- Define public goods and common resources. How are they similar an.pdf
a- Define public goods and common resources. How are they similar an.pdfa- Define public goods and common resources. How are they similar an.pdf
a- Define public goods and common resources. How are they similar an.pdf
 
A fin may be manufactured as an integral part of a surface by using .pdf
A fin may be manufactured as an integral part of a surface by using .pdfA fin may be manufactured as an integral part of a surface by using .pdf
A fin may be manufactured as an integral part of a surface by using .pdf
 
Which of the following statements is false Financial accounting mus.pdf
Which of the following statements is false Financial accounting mus.pdfWhich of the following statements is false Financial accounting mus.pdf
Which of the following statements is false Financial accounting mus.pdf
 
What does IPO underpricing refer to When in recent decades has it b.pdf
What does IPO underpricing refer to When in recent decades has it b.pdfWhat does IPO underpricing refer to When in recent decades has it b.pdf
What does IPO underpricing refer to When in recent decades has it b.pdf
 
When summing forces in the x direction why does Force of Ax be i.pdf
When summing forces in the x direction why does Force of Ax be i.pdfWhen summing forces in the x direction why does Force of Ax be i.pdf
When summing forces in the x direction why does Force of Ax be i.pdf
 
Which of the following statements true about Cyanobacteria Cyanobact.pdf
Which of the following statements true about Cyanobacteria Cyanobact.pdfWhich of the following statements true about Cyanobacteria Cyanobact.pdf
Which of the following statements true about Cyanobacteria Cyanobact.pdf
 
What is the temperature requited to denature myoglobin without guani.pdf
What is the temperature requited to denature myoglobin without guani.pdfWhat is the temperature requited to denature myoglobin without guani.pdf
What is the temperature requited to denature myoglobin without guani.pdf
 
Which agency monitors al Confirmed cases of food-borne illnes FDA. C.pdf
Which agency monitors al Confirmed cases of food-borne illnes FDA. C.pdfWhich agency monitors al Confirmed cases of food-borne illnes FDA. C.pdf
Which agency monitors al Confirmed cases of food-borne illnes FDA. C.pdf
 
What role does ethics play in leadership Do you believe that some p.pdf
What role does ethics play in leadership Do you believe that some p.pdfWhat role does ethics play in leadership Do you believe that some p.pdf
What role does ethics play in leadership Do you believe that some p.pdf
 
What is Simmonds’ disease aka pituitary cachexia Describe the featu.pdf
What is Simmonds’ disease aka pituitary cachexia Describe the featu.pdfWhat is Simmonds’ disease aka pituitary cachexia Describe the featu.pdf
What is Simmonds’ disease aka pituitary cachexia Describe the featu.pdf
 
6. All plants produce __________ by mitosis and __________ by meiosi.pdf
6. All plants produce __________ by mitosis and __________ by meiosi.pdf6. All plants produce __________ by mitosis and __________ by meiosi.pdf
6. All plants produce __________ by mitosis and __________ by meiosi.pdf
 
What is the pH of a solution that is formed at 25C by combining 300 .pdf
What is the pH of a solution that is formed at 25C by combining 300 .pdfWhat is the pH of a solution that is formed at 25C by combining 300 .pdf
What is the pH of a solution that is formed at 25C by combining 300 .pdf
 
ulsalullailut Ul glucose linked to muctose. Similarly, link ing three.pdf
ulsalullailut Ul glucose linked to muctose. Similarly, link ing three.pdfulsalullailut Ul glucose linked to muctose. Similarly, link ing three.pdf
ulsalullailut Ul glucose linked to muctose. Similarly, link ing three.pdf
 
This is a photograph of an organelle found in living cells. Use it to.pdf
This is a photograph of an organelle found in living cells. Use it to.pdfThis is a photograph of an organelle found in living cells. Use it to.pdf
This is a photograph of an organelle found in living cells. Use it to.pdf
 

Recently uploaded

Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 

Recently uploaded (20)

Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 

Java programing please help me. Hello, I tried making a Class Flight.pdf

  • 1. Java programing please help me. Hello, I tried making a Class Flight. Write a Class called Flight that has four member data items: number - the Flight Number, an integer destination - The Flight's Destination, a string status - the Status of the Flight, a char (B=Boarding, D=Departed, L=Landed, O=Out of Service) passengerList - The flight's list of passengers. ArrayList Write the constructor for initializing an object with an inital flight number, destination, initial status = Boarding, and the passengerList instantiated but empty Write get methods for each Data member. Write set methods for destination and status. write an addPasssenger method. Write a clearPassengers method. Write an equals member method to compare two Flight objects, and return true if their destinations are equal to each other, otherwise it returns false. Write a toString method that will display the values of the member data. Solution Flight.java import java.util.ArrayList; public class Flight { private int number; private String destination; private char status; ArrayList passengerList ; public Flight(int number, String destination){ this.number = number; this.destination = destination;
  • 2. status = 'B'; passengerList = new ArrayList(); } public String getDestination() { return destination; } public void setDestination(String destination) { this.destination = destination; } public char getStatus() { return status; } public void setStatus(char status) { this.status = status; } public int getNumber() { return number; } public void addPasssenger(String passenger){ passengerList.add(passenger); } public void clearPassengers(){ passengerList.clear(); } public boolean equals(Flight f){ if(this.destination.equals(f.destination)){ return true; } else{ return false; } } public String toString(){ return "Number: "+getNumber()+" Destination: "+getDestination()+" Status: "+getStatus(); }
  • 3. }