Hello I am building an book store and I receive this error message
Duplicate method getApparel(String) in type Bookstore
Apparel is a class in these methods. How I fix this. Eclipse suggest to rename these.
public Apparel getApparel(String id)
{
for(int i=0; i < apparel.size(); i++)
{
if(apparel.get(i).getId().equals(id))
{
return apparel.get(i);
}
}
return null;
}
public ArrayList<Apparel> getApparel(String name)
{
ArrayList<Apparel> apparel = new ArrayList<Apparel>();
for(int i=0; i < this.apparel.size(); i++)
{
if(this.apparel.get(i).getName().equals(name))
{
apparel.add(this.apparel.get(i));
}
}
return apparel;
}