java-scuola/NetBeans Projects/shape/src/shape/Shape.java

18 lines
392 B
Java
Raw Normal View History

2023-05-03 19:05:50 +02:00
package shape;
/**
*
2023-05-04 16:18:44 +02:00
* @author radaelli11353
2023-05-03 19:05:50 +02:00
*/
public abstract class Shape implements Comparable<Shape> {
2023-05-04 16:18:44 +02:00
public abstract double width();
public abstract double height();
public abstract double posX();
public abstract double posY();
2023-05-03 19:05:50 +02:00
@Override
public int compareTo(Shape o) {
2023-05-04 16:18:44 +02:00
return Double.compare(width() * height(), o.width() * o.height());
2023-05-03 19:05:50 +02:00
}
2023-05-04 16:18:44 +02:00
}