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 flat_geometric_shape {
- protected String nameFigure;
- protected double S;
- protected double P;
- public flat_geometric_shape()
- {
- S = 0.00;
- P = 0.00;
- this.nameFigure = new String("");
- }
- public flat_geometric_shape(String nameFigure) throws IllegalArgumentException
- {
- if(nameFigure.equals(""))
- throw new IllegalArgumentException("Нет имени у фигуры");
- S = 0.00;
- P = 0.00;
- this.nameFigure = new String(nameFigure);
- }
- public double getS()
- {
- return S;
- }
- public double getP()
- {
- return P;
- }
- public void P()
- {
- P = 0.0;
- }
- public void S()
- {
- S = 0.00;
- }
- public void setNameFigure(String nameFigure) throws IllegalArgumentException
- {
- if(nameFigure.equals(""))
- throw new IllegalArgumentException("Нет имени у фигуры");
- this.nameFigure = nameFigure;
- }
- public String getNameFigure()
- {
- return this.nameFigure;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement