J
justineee
Hello, I am checking if the ArrayList contains the string sales and
cost of goods sold.. I know the ArrayList contains the words but when
I check it through a method.. it returns false.
public boolean contains()
{
boolean x=false;
if (list.contains("sales")==true && list.contains("cost of goods
sold")==true)
{
x=true;
return x;
}
return x;
}
this is the method.. when I call this in System.out.print(), It shows
false but at the same time.. I displayed the words inside the
ArrayList and sales and cost of goods sold were displayed.. I think
the error is in this method.. Any help?
cost of goods sold.. I know the ArrayList contains the words but when
I check it through a method.. it returns false.
public boolean contains()
{
boolean x=false;
if (list.contains("sales")==true && list.contains("cost of goods
sold")==true)
{
x=true;
return x;
}
return x;
}
this is the method.. when I call this in System.out.print(), It shows
false but at the same time.. I displayed the words inside the
ArrayList and sales and cost of goods sold were displayed.. I think
the error is in this method.. Any help?