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

📄 newperson.java

📁 用java编写的一个电梯模型程序
💻 JAVA
字号:
/**
   NewPerson 类 
   有变量: currentFloor 为NewPerson 产生的楼层
            destination为他的目的楼层
            incr为楼层的高度
            allFloors为楼层的总层数
  有函数:  void setDestination( int  destination) //设置他的目的楼层
            int getDestination( )// 得到他的目的楼层
*/

import java.awt.Graphics;

public class NewPerson{
      public int currentFloor=0;  // NewPerson 产生的楼层
      private int destination=0;  // 他的目的楼层
      public int incr  = 0;       // 楼层的高度
      public int allFloors;       // 楼层的总层数
        
      public NewPerson(int currentFloor,int incr,int allFloors) { // 初始化函数
             this.currentFloor = currentFloor;
             this.incr = incr;
             this.allFloors = allFloors;
      }
      public void setDestination( int  destination) {     //设置他的目的楼层
            this.destination = destination;
      }
      public int getDestination( ) {    // 得到他的目的楼层
            return (this.destination);
      }
  
}

⌨️ 快捷键说明

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