public int compareTo(Object o) { if (this.getlato() > ((Cubo)o).getlato() ) return 1; else if (this.getlato() < ((Cubo)o).getlato() ) return -1; else return 0; }