Import java. util. *;/* class loading sequence: first, execute static fields and static code blocks, then execute instance fields and common code blocks, and then execute constructors. */Public class sample {public static void main (string [] ARGs) {employee [] Staff = new employee [3]; staff [0] = new employee ("Harry ", 40000); staff [1] = new employee (60000); staff [2] = new employee (); For (employee item: Staff) {system. out. println ("name =" + item. getname () + ", id =" + item. GETID () + ", salary =" + item. getsalary () ;}} class employee {public employee (string N, double S) {This. name = N; this. sala Ry = s;} public employee (double S) {This ("Employee #" + nextid, S); // it must be the first line; otherwise, the compilation is incorrect, it cannot be used with super.} Public employee () {// If a class does not define its own constructor, the system will provide its own default constructor.} Public String getname () {return name;} public double getsalary () {return salary;} public int GETID () {return ID;} Private Static int nextid; private int ID; private string name = ""; private double salary; {// code block id = nextid; nextid ++;} static {// static code block random generator = new random (); nextid = generator. nextint (10000 );}}