Advertisement
Benz_Coe

Polygon

Mar 21st, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.25 KB | None | 0 0
  1. public abstract class Polygon {
  2.     protected int n;
  3.     protected double[] sides;
  4.     protected double area;
  5.     abstract public void calArea();
  6.     public double getArea() {
  7.         return area;
  8.     }
  9.     public Polygon(int nb) {
  10.         n = nb;
  11.         sides = new double[n];
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement