shape.java

来自「一个大学本科java课程的大作业。要求利用GUI以及APPLET分别完成一个任务」· Java 代码 · 共 56 行

JAVA
56
字号

/**
 *Title:Shape.java
 *Descrption: This abstract class define the general shape.
 *@author: Peng yu
 *@version:1.0
 */


public abstract class Shape
{
  
      protected int height;
      protected int width;
      protected int base;            //define three variables
	
      public abstract double calcShapeArea();         //abstract method to calculate the area
      public abstract double calcShapePerimeter();    //abstract method to calculate the perimeter
 

  
    
     /**
      * This method simply gets the height of the shape
      * @return the height of the shape
      */
      public int getHeight() 
      {
	     return this.height;
      }

    


     /**
      * This method simply gets the width of the shape
      * @return the width of the shape
      */
      public int getWidth() 
      {
             return this.width;
      }

	
	
	
     /**
      * This method simply gets the base of the shape
      * @return the base of the shape
      */
      public int getBase() 
      {
	     return this.base;
      }
	
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?