SlideShare a Scribd company logo
1 of 5
Download to read offline
package patienttest;
import java.util.Comparator;
import java.util.Date;
public class Patient implements Comparator{
String Name;
Date DOB;
Date Admission;
String Complaint;
int Priority;
public Patient(String name,Date d1,Date ad,String complaint,int p)
{
Name=name;
DOB=d1;
Admission=ad;
Complaint=complaint;
Priority=p;
}
public void setName(String name)
{
Name=name;
}
public void setDOB(Date d1)
{
DOB=d1;
}
public void setAdmission(Date d2)
{
Admission=d2;
}
public void setComplaint(String complaint)
{
Complaint=complaint;
}
public void setPriority(int p)
{
Priority=p;
}
public String setName()
{
return Name;
}
public Date setDOB()
{
return DOB;
}
public Date setAdmission()
{
return Admission;
}
public String setComplaint()
{
return Complaint;
}
public int setPriority()
{
return Priority;
}
@Override
public String toString()
{
String msg="";
msg+="Name: "+Name;
msg+="DOB: "+DOB;
msg+="Admission: "+Admission;
msg+="Complaint: "+Complaint;
msg+="Priority: "+Priority;
return msg;
}
@Override
public int compare(Patient p1, Patient p2) {
int value=1;
if(p1.Priority>p2.Priority)
value=1;
else if(p1.Priority0)
value=1;
else
value=-1;
}
return value;
}
}
Solution
package patienttest;
import java.util.Comparator;
import java.util.Date;
public class Patient implements Comparator{
String Name;
Date DOB;
Date Admission;
String Complaint;
int Priority;
public Patient(String name,Date d1,Date ad,String complaint,int p)
{
Name=name;
DOB=d1;
Admission=ad;
Complaint=complaint;
Priority=p;
}
public void setName(String name)
{
Name=name;
}
public void setDOB(Date d1)
{
DOB=d1;
}
public void setAdmission(Date d2)
{
Admission=d2;
}
public void setComplaint(String complaint)
{
Complaint=complaint;
}
public void setPriority(int p)
{
Priority=p;
}
public String setName()
{
return Name;
}
public Date setDOB()
{
return DOB;
}
public Date setAdmission()
{
return Admission;
}
public String setComplaint()
{
return Complaint;
}
public int setPriority()
{
return Priority;
}
@Override
public String toString()
{
String msg="";
msg+="Name: "+Name;
msg+="DOB: "+DOB;
msg+="Admission: "+Admission;
msg+="Complaint: "+Complaint;
msg+="Priority: "+Priority;
return msg;
}
@Override
public int compare(Patient p1, Patient p2) {
int value=1;
if(p1.Priority>p2.Priority)
value=1;
else if(p1.Priority0)
value=1;
else
value=-1;
}
return value;
}
}

More Related Content

Similar to package patienttest;import java.util.Comparator; import java..pdf

Project .javaimport java.util.;public class Project impleme.pdf
Project .javaimport java.util.;public class Project impleme.pdfProject .javaimport java.util.;public class Project impleme.pdf
Project .javaimport java.util.;public class Project impleme.pdfaquacosmossystems
 
import java.util.Arrays;import java.util.List;public class Bursa.pdf
import java.util.Arrays;import java.util.List;public class Bursa.pdfimport java.util.Arrays;import java.util.List;public class Bursa.pdf
import java.util.Arrays;import java.util.List;public class Bursa.pdfarpowersarps
 
can do this in java please thanks in advance The code that y.pdf
can do this in java please thanks in advance The code that y.pdfcan do this in java please thanks in advance The code that y.pdf
can do this in java please thanks in advance The code that y.pdfakshpatil4
 
Patient.java package A9.toStudents; public class Patient imple.pdf
Patient.java package A9.toStudents; public class Patient imple.pdfPatient.java package A9.toStudents; public class Patient imple.pdf
Patient.java package A9.toStudents; public class Patient imple.pdfDEEPAKSONI562
 
BasicPizza.javapublic class BasicPizza { String type; String c.pdf
BasicPizza.javapublic class BasicPizza { String type; String c.pdfBasicPizza.javapublic class BasicPizza { String type; String c.pdf
BasicPizza.javapublic class BasicPizza { String type; String c.pdfrdtraders2007
 
Here is the codeimport java.util.; class GroceryItem { Stri.pdf
Here is the codeimport java.util.; class GroceryItem { Stri.pdfHere is the codeimport java.util.; class GroceryItem { Stri.pdf
Here is the codeimport java.util.; class GroceryItem { Stri.pdfanand1213
 
public class Patient extends Person {=========== Properties ====.pdf
public class Patient extends Person {=========== Properties ====.pdfpublic class Patient extends Person {=========== Properties ====.pdf
public class Patient extends Person {=========== Properties ====.pdfarishmarketing21
 
Having a problem figuring out where my errors are- The code is not run.pdf
Having a problem figuring out where my errors are- The code is not run.pdfHaving a problem figuring out where my errors are- The code is not run.pdf
Having a problem figuring out where my errors are- The code is not run.pdfNicholasflqStewartl
 

Similar to package patienttest;import java.util.Comparator; import java..pdf (9)

Project .javaimport java.util.;public class Project impleme.pdf
Project .javaimport java.util.;public class Project impleme.pdfProject .javaimport java.util.;public class Project impleme.pdf
Project .javaimport java.util.;public class Project impleme.pdf
 
import java.util.Arrays;import java.util.List;public class Bursa.pdf
import java.util.Arrays;import java.util.List;public class Bursa.pdfimport java.util.Arrays;import java.util.List;public class Bursa.pdf
import java.util.Arrays;import java.util.List;public class Bursa.pdf
 
can do this in java please thanks in advance The code that y.pdf
can do this in java please thanks in advance The code that y.pdfcan do this in java please thanks in advance The code that y.pdf
can do this in java please thanks in advance The code that y.pdf
 
Patient.java package A9.toStudents; public class Patient imple.pdf
Patient.java package A9.toStudents; public class Patient imple.pdfPatient.java package A9.toStudents; public class Patient imple.pdf
Patient.java package A9.toStudents; public class Patient imple.pdf
 
BasicPizza.javapublic class BasicPizza { String type; String c.pdf
BasicPizza.javapublic class BasicPizza { String type; String c.pdfBasicPizza.javapublic class BasicPizza { String type; String c.pdf
BasicPizza.javapublic class BasicPizza { String type; String c.pdf
 
Solid
SolidSolid
Solid
 
Here is the codeimport java.util.; class GroceryItem { Stri.pdf
Here is the codeimport java.util.; class GroceryItem { Stri.pdfHere is the codeimport java.util.; class GroceryItem { Stri.pdf
Here is the codeimport java.util.; class GroceryItem { Stri.pdf
 
public class Patient extends Person {=========== Properties ====.pdf
public class Patient extends Person {=========== Properties ====.pdfpublic class Patient extends Person {=========== Properties ====.pdf
public class Patient extends Person {=========== Properties ====.pdf
 
Having a problem figuring out where my errors are- The code is not run.pdf
Having a problem figuring out where my errors are- The code is not run.pdfHaving a problem figuring out where my errors are- The code is not run.pdf
Having a problem figuring out where my errors are- The code is not run.pdf
 

More from annucommunication1

4r = 2 L2r = L2thats none of the above, since you didnt wrote t.pdf
4r = 2 L2r = L2thats none of the above, since you didnt wrote t.pdf4r = 2 L2r = L2thats none of the above, since you didnt wrote t.pdf
4r = 2 L2r = L2thats none of the above, since you didnt wrote t.pdfannucommunication1
 
41.Ans. Ans,Sarcoplasmic reticulumSarcoplasmic reticulum is a type.pdf
41.Ans. Ans,Sarcoplasmic reticulumSarcoplasmic reticulum is a type.pdf41.Ans. Ans,Sarcoplasmic reticulumSarcoplasmic reticulum is a type.pdf
41.Ans. Ans,Sarcoplasmic reticulumSarcoplasmic reticulum is a type.pdfannucommunication1
 
1.c. developers2.e. A and B3.c. Land and Built space4. Money a.pdf
1.c. developers2.e. A and B3.c. Land and Built space4. Money a.pdf1.c. developers2.e. A and B3.c. Land and Built space4. Money a.pdf
1.c. developers2.e. A and B3.c. Land and Built space4. Money a.pdfannucommunication1
 
will result in the formation of a soluble complex.pdf
                     will result in the formation of a soluble complex.pdf                     will result in the formation of a soluble complex.pdf
will result in the formation of a soluble complex.pdfannucommunication1
 
What types of elements are involved in metallic b.pdf
                     What types of elements are involved in metallic b.pdf                     What types of elements are involved in metallic b.pdf
What types of elements are involved in metallic b.pdfannucommunication1
 
The correct statements are When two atoms of app.pdf
                     The correct statements are  When two atoms of app.pdf                     The correct statements are  When two atoms of app.pdf
The correct statements are When two atoms of app.pdfannucommunication1
 
One P2O5 contains five oxygen 3.45 x 5 = 17.3 mol.pdf
                     One P2O5 contains five oxygen 3.45 x 5 = 17.3 mol.pdf                     One P2O5 contains five oxygen 3.45 x 5 = 17.3 mol.pdf
One P2O5 contains five oxygen 3.45 x 5 = 17.3 mol.pdfannucommunication1
 
Na2O is basic NO2 is acidic SO2 is acidic CO2 is .pdf
                     Na2O is basic NO2 is acidic SO2 is acidic CO2 is .pdf                     Na2O is basic NO2 is acidic SO2 is acidic CO2 is .pdf
Na2O is basic NO2 is acidic SO2 is acidic CO2 is .pdfannucommunication1
 
moles of CO2 = moles of NaHCO3 = 284 =0.0238 .pdf
                     moles of CO2 = moles of NaHCO3 = 284 =0.0238    .pdf                     moles of CO2 = moles of NaHCO3 = 284 =0.0238    .pdf
moles of CO2 = moles of NaHCO3 = 284 =0.0238 .pdfannucommunication1
 
Eukaryotic Chromosome Structure The length of DN.pdf
                     Eukaryotic Chromosome Structure  The length of DN.pdf                     Eukaryotic Chromosome Structure  The length of DN.pdf
Eukaryotic Chromosome Structure The length of DN.pdfannucommunication1
 
Fe + S ---- FeS moles of Fe = 9.4256 = 0.1682 m.pdf
                     Fe + S ---- FeS moles of Fe = 9.4256 = 0.1682 m.pdf                     Fe + S ---- FeS moles of Fe = 9.4256 = 0.1682 m.pdf
Fe + S ---- FeS moles of Fe = 9.4256 = 0.1682 m.pdfannucommunication1
 
The various ways to finance a project are 1)Debt financing-One ca.pdf
The various ways to finance a project are 1)Debt financing-One ca.pdfThe various ways to finance a project are 1)Debt financing-One ca.pdf
The various ways to finance a project are 1)Debt financing-One ca.pdfannucommunication1
 
boiling point 1-propanol propanone note there.pdf
                     boiling point 1-propanol  propanone note there.pdf                     boiling point 1-propanol  propanone note there.pdf
boiling point 1-propanol propanone note there.pdfannucommunication1
 
The organs of urinary system includesPaired kidneys, paired ureter.pdf
The organs of urinary system includesPaired kidneys, paired ureter.pdfThe organs of urinary system includesPaired kidneys, paired ureter.pdf
The organs of urinary system includesPaired kidneys, paired ureter.pdfannucommunication1
 
The incorrect statement ise. Glucose is a stereoisomer of ribose..pdf
The incorrect statement ise. Glucose is a stereoisomer of ribose..pdfThe incorrect statement ise. Glucose is a stereoisomer of ribose..pdf
The incorrect statement ise. Glucose is a stereoisomer of ribose..pdfannucommunication1
 
The answer is a. The intermolecular forces are much greater in wate.pdf
The answer is a. The intermolecular forces are much greater in wate.pdfThe answer is a. The intermolecular forces are much greater in wate.pdf
The answer is a. The intermolecular forces are much greater in wate.pdfannucommunication1
 
potassium and sulfur - K2S Ionic Bondcalcium and chlorine - CaCl2 .pdf
potassium and sulfur - K2S Ionic Bondcalcium and chlorine - CaCl2 .pdfpotassium and sulfur - K2S Ionic Bondcalcium and chlorine - CaCl2 .pdf
potassium and sulfur - K2S Ionic Bondcalcium and chlorine - CaCl2 .pdfannucommunication1
 

More from annucommunication1 (20)

4r = 2 L2r = L2thats none of the above, since you didnt wrote t.pdf
4r = 2 L2r = L2thats none of the above, since you didnt wrote t.pdf4r = 2 L2r = L2thats none of the above, since you didnt wrote t.pdf
4r = 2 L2r = L2thats none of the above, since you didnt wrote t.pdf
 
41.Ans. Ans,Sarcoplasmic reticulumSarcoplasmic reticulum is a type.pdf
41.Ans. Ans,Sarcoplasmic reticulumSarcoplasmic reticulum is a type.pdf41.Ans. Ans,Sarcoplasmic reticulumSarcoplasmic reticulum is a type.pdf
41.Ans. Ans,Sarcoplasmic reticulumSarcoplasmic reticulum is a type.pdf
 
1.c. developers2.e. A and B3.c. Land and Built space4. Money a.pdf
1.c. developers2.e. A and B3.c. Land and Built space4. Money a.pdf1.c. developers2.e. A and B3.c. Land and Built space4. Money a.pdf
1.c. developers2.e. A and B3.c. Land and Built space4. Money a.pdf
 
ZnO + H2O = Zn(OH)2 .pdf
                     ZnO + H2O = Zn(OH)2                             .pdf                     ZnO + H2O = Zn(OH)2                             .pdf
ZnO + H2O = Zn(OH)2 .pdf
 
will result in the formation of a soluble complex.pdf
                     will result in the formation of a soluble complex.pdf                     will result in the formation of a soluble complex.pdf
will result in the formation of a soluble complex.pdf
 
What types of elements are involved in metallic b.pdf
                     What types of elements are involved in metallic b.pdf                     What types of elements are involved in metallic b.pdf
What types of elements are involved in metallic b.pdf
 
The correct statements are When two atoms of app.pdf
                     The correct statements are  When two atoms of app.pdf                     The correct statements are  When two atoms of app.pdf
The correct statements are When two atoms of app.pdf
 
Sure can There you go. .pdf
                     Sure can  There you go.                         .pdf                     Sure can  There you go.                         .pdf
Sure can There you go. .pdf
 
One P2O5 contains five oxygen 3.45 x 5 = 17.3 mol.pdf
                     One P2O5 contains five oxygen 3.45 x 5 = 17.3 mol.pdf                     One P2O5 contains five oxygen 3.45 x 5 = 17.3 mol.pdf
One P2O5 contains five oxygen 3.45 x 5 = 17.3 mol.pdf
 
Na2O is basic NO2 is acidic SO2 is acidic CO2 is .pdf
                     Na2O is basic NO2 is acidic SO2 is acidic CO2 is .pdf                     Na2O is basic NO2 is acidic SO2 is acidic CO2 is .pdf
Na2O is basic NO2 is acidic SO2 is acidic CO2 is .pdf
 
moles of CO2 = moles of NaHCO3 = 284 =0.0238 .pdf
                     moles of CO2 = moles of NaHCO3 = 284 =0.0238    .pdf                     moles of CO2 = moles of NaHCO3 = 284 =0.0238    .pdf
moles of CO2 = moles of NaHCO3 = 284 =0.0238 .pdf
 
Eukaryotic Chromosome Structure The length of DN.pdf
                     Eukaryotic Chromosome Structure  The length of DN.pdf                     Eukaryotic Chromosome Structure  The length of DN.pdf
Eukaryotic Chromosome Structure The length of DN.pdf
 
Fe + S ---- FeS moles of Fe = 9.4256 = 0.1682 m.pdf
                     Fe + S ---- FeS moles of Fe = 9.4256 = 0.1682 m.pdf                     Fe + S ---- FeS moles of Fe = 9.4256 = 0.1682 m.pdf
Fe + S ---- FeS moles of Fe = 9.4256 = 0.1682 m.pdf
 
D. is correct. Solution .pdf
                     D. is correct.  Solution                     .pdf                     D. is correct.  Solution                     .pdf
D. is correct. Solution .pdf
 
The various ways to finance a project are 1)Debt financing-One ca.pdf
The various ways to finance a project are 1)Debt financing-One ca.pdfThe various ways to finance a project are 1)Debt financing-One ca.pdf
The various ways to finance a project are 1)Debt financing-One ca.pdf
 
boiling point 1-propanol propanone note there.pdf
                     boiling point 1-propanol  propanone note there.pdf                     boiling point 1-propanol  propanone note there.pdf
boiling point 1-propanol propanone note there.pdf
 
The organs of urinary system includesPaired kidneys, paired ureter.pdf
The organs of urinary system includesPaired kidneys, paired ureter.pdfThe organs of urinary system includesPaired kidneys, paired ureter.pdf
The organs of urinary system includesPaired kidneys, paired ureter.pdf
 
The incorrect statement ise. Glucose is a stereoisomer of ribose..pdf
The incorrect statement ise. Glucose is a stereoisomer of ribose..pdfThe incorrect statement ise. Glucose is a stereoisomer of ribose..pdf
The incorrect statement ise. Glucose is a stereoisomer of ribose..pdf
 
The answer is a. The intermolecular forces are much greater in wate.pdf
The answer is a. The intermolecular forces are much greater in wate.pdfThe answer is a. The intermolecular forces are much greater in wate.pdf
The answer is a. The intermolecular forces are much greater in wate.pdf
 
potassium and sulfur - K2S Ionic Bondcalcium and chlorine - CaCl2 .pdf
potassium and sulfur - K2S Ionic Bondcalcium and chlorine - CaCl2 .pdfpotassium and sulfur - K2S Ionic Bondcalcium and chlorine - CaCl2 .pdf
potassium and sulfur - K2S Ionic Bondcalcium and chlorine - CaCl2 .pdf
 

Recently uploaded

Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxAdelaideRefugio
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSean M. Fox
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppCeline George
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportDenish Jangid
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFVivekanand Anglo Vedic Academy
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxMarlene Maheu
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaEADTU
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17Celine George
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptxVishal Singh
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code ExamplesPeter Brusilovsky
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjMohammed Sikander
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi RajagopalEADTU
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MysoreMuleSoftMeetup
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................MirzaAbrarBaig5
 

Recently uploaded (20)

Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)ESSENTIAL of (CS/IT/IS) class 07 (Networks)
ESSENTIAL of (CS/IT/IS) class 07 (Networks)
 
The Liver & Gallbladder (Anatomy & Physiology).pptx
The Liver &  Gallbladder (Anatomy & Physiology).pptxThe Liver &  Gallbladder (Anatomy & Physiology).pptx
The Liver & Gallbladder (Anatomy & Physiology).pptx
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 

package patienttest;import java.util.Comparator; import java..pdf

  • 1. package patienttest; import java.util.Comparator; import java.util.Date; public class Patient implements Comparator{ String Name; Date DOB; Date Admission; String Complaint; int Priority; public Patient(String name,Date d1,Date ad,String complaint,int p) { Name=name; DOB=d1; Admission=ad; Complaint=complaint; Priority=p; } public void setName(String name) { Name=name; } public void setDOB(Date d1) { DOB=d1; } public void setAdmission(Date d2) { Admission=d2; } public void setComplaint(String complaint) { Complaint=complaint; } public void setPriority(int p)
  • 2. { Priority=p; } public String setName() { return Name; } public Date setDOB() { return DOB; } public Date setAdmission() { return Admission; } public String setComplaint() { return Complaint; } public int setPriority() { return Priority; } @Override public String toString() { String msg=""; msg+="Name: "+Name; msg+="DOB: "+DOB; msg+="Admission: "+Admission; msg+="Complaint: "+Complaint; msg+="Priority: "+Priority; return msg; } @Override public int compare(Patient p1, Patient p2) {
  • 3. int value=1; if(p1.Priority>p2.Priority) value=1; else if(p1.Priority0) value=1; else value=-1; } return value; } } Solution package patienttest; import java.util.Comparator; import java.util.Date; public class Patient implements Comparator{ String Name; Date DOB; Date Admission; String Complaint; int Priority; public Patient(String name,Date d1,Date ad,String complaint,int p) { Name=name; DOB=d1; Admission=ad; Complaint=complaint; Priority=p; } public void setName(String name) { Name=name; }
  • 4. public void setDOB(Date d1) { DOB=d1; } public void setAdmission(Date d2) { Admission=d2; } public void setComplaint(String complaint) { Complaint=complaint; } public void setPriority(int p) { Priority=p; } public String setName() { return Name; } public Date setDOB() { return DOB; } public Date setAdmission() { return Admission; } public String setComplaint() { return Complaint; } public int setPriority() { return Priority; }
  • 5. @Override public String toString() { String msg=""; msg+="Name: "+Name; msg+="DOB: "+DOB; msg+="Admission: "+Admission; msg+="Complaint: "+Complaint; msg+="Priority: "+Priority; return msg; } @Override public int compare(Patient p1, Patient p2) { int value=1; if(p1.Priority>p2.Priority) value=1; else if(p1.Priority0) value=1; else value=-1; } return value; } }