import java.util.*;
class Employee
{
public Employee(String n,double s)
{
name =n; salary =s; }
public Employee()
{} public String getName()
{
return name;
}
public double getSalary()
{
return salary;
}

private String name; private double salary;};
class Emp
{
public static void main(String[] args) 
{ ArrayList list =new ArrayList(); Employee[] man =new Employee[2]; man[0] =new Employee("myself",10000); man[1] =new Employee("dp",8000);

int i =0; while (i <man.length)
{
list.add(man[i]);
i++;
}

for(int j= 0; j <list.size(); j ++)
{
if(list.get(j) instanceof Employee) System.out.println("Name:"+man[j].getName()+",Salary:"+man[j].getSalary());
}
}
}
编译时给出警告:Note: Emp.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Emp.java:95: warning: [unchecked] unchecked call to add(E) as a member of the ra
w type java.util.ArrayList
                        list.add(man[i]);
                                ^