I have a problem that I'm trying to Solve. I want to create an ArrayList of unknown number of elements, and in that ArrayList place other ArrayLists. For example: A hospital queue, and within this queue I want to have different queues based in the priority of the patient.
System.out.println("whats the maximum priority?");
int maxPriority = Scan.nextInt();
//Trying to create a new ArrayList in every ArrayList index.
for(int k=0; k<maxPriority;k++){
queues[k] = new Arraylist();
}
//trying to create a "patient"-object with a name and priority
public static patient(String name, int priority){
this.name=name;
this.priority=priority;
}
// trying to get the priority of a patient//
public static getPriority(){
return priority;
}
// Trying to add the patient last in the correct "priority queue"
public static placePatient()){
queues.add(patient.getPriority)
}