I've got a class foo, a class that derives from food called bar, and I've got a method in foo that takes another foo
boolean baz(foo c)
{
return (condition)?true:false;
}
I want to write an overload for baz that takes a Vector and calls baz on all of them -- something like
boolean baz(Vector<foo> v)
{
for(int i=0;i<v.size();++i)
{
if baz(v.get(i))
return true;
}
return false;
}
and I want to use call this method on a Vector of bar. I tried writing this in the way I just outlined, and I get compiler errors when I try to call this method on a vector of bar.
What am I missing?