コード例 #1
0
  public static void main(String[] args) {
    // fill the staff array with three Employee objects
    Employee4[] staff = new Employee4[3];
    staff[0] = new Employee4("Harry", 40000);
    staff[1] = new Employee4(60000);
    staff[2] = new Employee4();

    // print out information about all Employee objects
    for (Employee4 e : staff)
      System.out.println("name=" + e.getName() + ",id=" + e.getId() + ",salary=" + e.getSalary());
  }