about summary refs log tree commit diff
path: root/usth/ICT2.2/labwork/5/Java/abstract/Shape.java
blob: dd4124c7e24a6ed3ff7f4b0196d56f11502d2e8b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
public abstract class Shape
{
  public double calArea() { return 0.0; }
  public double calVolume() { return 0.0; }
  public abstract String getName();

  public String toString()
  {
    return String.format("%s of area %g and volume %g",
                         getName(), calArea(), calVolume());
  }
}