public void searchLastName(String lastName)
{
int size = list.size();
for(int i = 0 ; i < size ; i++)
{
if(list.get(i).getLastName().equals(lastName))
System.out.print(lastName+ " is located at " +i);
else
System.out.println("Cant find at loc:" +i);
}
}
这段代码有问题吗??我无法搜索姓氏..请帮帮我
这是来自 Person 类
public String getLastName()
{
return lastName;
}