The title might be a little confusing but what I want to know is how can I change the ' b ' part in mainsave.b so that it will define it within the object.
Here is my code so far
public void getItem(int a, String b)
{
mainsave.b = a;
}
The values are being sent from this piece of code in another class called Story. I want them to be stored in the object of class SaveFile which is what 'mainsave' is
if (command_string.equals("1"))
{
try {Thread.sleep(1500);} catch (InterruptedException e) {}
System.out.println("You search the shed thouroughly and find an axe but not much else...");
int item = 1;
String axe = "axe";
getItem(item,axe);
try {Thread.sleep(1500);} catch (InterruptedException e) {}
area1();
}
The error I get when trying to compile the first part is "cannot find symbol - variable b"