Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- /**
- * Created by admin on 23.10.2018.
- */
- public class Square extends flat_geometric_shape {
- protected double length;
- public Square(double len, String nameFigure) throws IllegalArgumentException
- {
- super(nameFigure);
- if(len <= 0)
- throw new IllegalArgumentException("Длина стороны квадрата <= 0");
- this.length = len;
- }
- @Override
- public void S()
- {
- S = length*length;
- }
- @Override
- public void P()
- {
- P = 4*length;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement