Java类变量 静态变量示例


Java类变量 静态变量示例

import java.io.*;

public class Employee {



   // salary  variable is a private static variable

   private static double salary;



   // DEPARTMENT is a constant

   public static final String DEPARTMENT = "Development ";



   public static void main(String args[]) {

      salary = 1000;

      System.out.println(DEPARTMENT + "average salary:" + salary);

   }

}