⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shape.java

📁 一个大学本科java课程的大作业。要求利用GUI以及APPLET分别完成一个任务:随机产生三角形
💻 JAVA
字号:

/**
 *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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -