I start with Java, and I make a simple text RPG, and I want to store character information in a class like Name, Job, Age, etc. For instance:
class myChar { String name = ""; String job = ""; int age = 0;
And I want the user to be able to ask what their name, work, etc., and pass it back to the class so that it can be pulled later. I understand how to do this with ints quite well, for example, I have a Stats class where HP is stored, attack power, etc.:
class Stats // Demonstrates Class { int hp = 10;
So, as you can see, I understand this a little, but I'm not quite sure how to do this so that the player can enter this information and save it. I understand this use:
Stats myStats = new Stats("John", "Warrior", 30);
When it comes to identifying information, but not to allow the player to choose it for themselves. Sorry if I speak too vaguely, I update my post as necessary!
Edit: I have a main public class that contains different "rooms", etc. It is quite long and I know how to get user input. For example, I have a command window that allows the user to “watch,” “use,” “receive,” etc. Therefore, I understand user input well. I just don’t understand how the user enters information and stores this information in an external class that will be called later.