program10_3.java

来自「《A first book of java》by Gary J.Bronson 」· Java 代码 · 共 25 行

JAVA
25
字号
public class Employee
{
  // class variable declaration section
  private static double taxRate = 0.0025;
  private int idNum;
  // class method definition section
  public Employee(int num)  // constructor
  {
    idNum = num;
  }
  public void display()
  {
    System.out.println("Employee number " + idNum
               + " has a tax rate of " + taxRate);
  } 
  
  public static void main(String[] args)
  {
    Employee BSMITH = new Employee(11122);
    Employee JJONES = new Employee(11133);
    BSMITH.display();
    JJONES.display();
  }
}              

⌨️ 快捷键说明

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