import java.util.Date;
class House implements Cloneable,Comparable
{
private int id;
private double area;
private Date Whenbuilt;
public House(int id,double area)
{
this.id=id;
this.area=area;
Whenbuilt=new Date();
}
public String toString()
{
return id+" "+area+" "+Whenbuilt;
}
public int compareTo(Object o)
{
if(area>((House)o).area)
return 1;
else if(area<((House)o).area)
return -1;
return 0;
}
public Object clone() throws CloneNotSupportedException
{
return super.clone();
}
}
what is the difference if i put (implements Comparable) and if i dont