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

📄 shape.java

📁 包括Rect,Circle两个类
💻 JAVA
字号:

// Shape class: meant to be a super class for shapes that can act

import java.awt.*;

public class Shape
{
   protected int xpos;
   protected int ypos;

   public Shape( )
   {
      xpos = 0;
      ypos = 0;
   }

   public Shape( int x, int y )
   {
      xpos = x;
      ypos = y;
   }

   public void moveRight()
   {
      xpos += 5;
   }

   public void moveLeft()
   {
      xpos -= 5;
   }
   
   public void act()
   {
   }

   public void draw( Graphics g )
   {
   }
}

⌨️ 快捷键说明

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