Class Figure

  • Direct Known Subclasses:
    Circle, Triangle

    public abstract class Figure
    extends java.lang.Object
    Parent class for figures.
    • Constructor Summary

      Constructors 
      Constructor Description
      Figure()  
      Figure​(java.lang.String unit)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract double surface()
      Abstract class that should return the surface of a figure.
      java.lang.String surfaceString()
      Prints the surface of the figure.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Figure

        public Figure​(java.lang.String unit)
      • Figure

        public Figure()
    • Method Detail

      • surface

        public abstract double surface()
        Abstract class that should return the surface of a figure.
        Returns:
        The surface of the figure in the form of a double.
      • surfaceString

        public java.lang.String surfaceString()
        Prints the surface of the figure.
        Returns:
        A string describing the figure's surface.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object