- Thread Author
- #1
I'm declaring the name of the item as a string and using Inventory.getQuantity(String) to obtain the amount of said item in order to see how many are in my inventory. I'm getting the error "Incompatible types. Found: 'java.lang.Integer, required: boolean". I can't find a solution in the API and any help would be appreciated. Here is the code:
Code:
public boolean validate() {
String thefoodofchoice = ("Monkfish");
Integer howmany = Inventory.getQuantity(thefoodofchoice);
if (howmany = 3){
return true;
}else{
return false;
}
}