import java.util.*; /* Queue q = new FIFOQueue(); * * First-In, First-Out * */ public class Hospital { public static void main(String[] args) { /* The second argument represents "how close to death" the ERPatient is. The larger the number, the more severe the injury... */ /* this is not the queue we've been using...there's a reason and we'll talk about it */ Queue line = new PriorityQueue(); line.add(new ERPatient("Bob Belcher", 42)); line.add(new ERPatient("Philip J. Fry", 1077)); line.add(new ERPatient("The Count", 1234)); line.add(new ERPatient("Loch Ness Monster", 350)); line.add(new ERPatient("Barry Allen", 2024)); line.add(new ERPatient("Jean Luc Picard", 1701)); while (!line.isEmpty()) { System.out.println("Saving " + line.remove() + "."); } } }