Out of curiosity, why not do this?
Code:
public ProductSpecification getSpecification(String itemCode)
{
//System.out.println(itemCode);
for (int i = 0; i < productSpecifications.length; i++)
{
if (itemCode.equals(productSpecifications[i].getItemId()))
{
return productSpecifications[i];
}
}
return null;
}
As for your error, it sounds like ProductSpecifications is undefined when you run this function.