很菜的问题,但思维转不过来了,求点拨 public class Employee {
private String name;
private double salary;
public Employee(String n,double s){
name = n;
salary =s;
}
public class Test {
public static void main(String[] args) {
Employee [] abc= new Employee[3];
abc [0]= new Employee("Alice", 70000);
abc [1] = new Employee("Bob",60000);
abc [2]= new Employee("Plice", 50000);
abc [2]=abc[0];
abc [0]=abc[1];
abc[1]=abc [2];
for(Employee e:abc){
System.out.println(e.getName()+"\t"+e.getSalary());
}