about summary refs log tree commit diff
path: root/usth/ICT2.2/labwork/5/Java/interface/Point.java
blob: 90b25696fdbc545a3e8d285a5a298555ee0d0a4b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
public class Point implements Shape
{
  public double x;
  public double y;

  public Point(double x, double y)
  {
    this.x = x;
    this.y = y;
  }

  public double calArea() { return 0.0; }
  public double calVolume() { return 0.0; }
  public String getName() { return "Point"; }

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