Return question in a method.
I need to return more than one variable from a method I run.
The first time the method is every run, it will return a 1, and every time it is run after that, it will return a 0 instead. I've got that down pat. Now, after the method does a few things from the user, I want it to return another variable (int) also, which I want to use to add to another variable in my main method.
Is this possible? I'm sorry that I'm so new to Java. :(
Example:
public class itemShop1 {
public static int itemShop(int beenBefore) {
if(beenBefore == 0) {
return 1;
}
else {
return 0;
}
// More code here, where people can buy items, and it returns the amount bought, and deducts a given amount of gold.
}
}