I need to make a program using at first an OrderedList (already defined with succes) and then a list of names with a priority number...
The problem is that I must define a type of object (Paziente) with two values (a String as a name and an int as a pririty value), but i must make this type working as a Comparable ( i MUST use Comparable objects)...
this is the class Paziente I tried to make:

public class Paziente implements Comparable{

private String nome; //name
private int prio; //priority

public Paziente(String k, int i) {

public int compareTo(Paziente x){
if (this.prio>x.prio) return 1;
if (this.prio<x.prio) return -1;
else {int comp=this.nome.compareTo(x.nome);
if (comp>0) return 1;
if (comp<0) return -1;
else return 0;

can u tell me where i'm doing wrong? Thx in advantage