brent carter wrote:... I know how to call variables from other classes like I did with my CharClasses class but how does it work when calling from the main class? ...
A "main class" is simply a class that contains a main method, which is
Java's entry point. Using members (variables or methods) of that class is no different than using members of any other class. Indeed, you can even call the main method directly if you wish, just like any other static method.
brent carter wrote:... Also, Im pretty sure this code makes no sense because when I make a new main and call it main2 charpick hasnt happened for this new calling. Is this correct? ...
That's correct. What's more, charpick is defined locally within the main method, so (unless there is also another "charpick" defined at the class level) main2.charpick has no meaning.
What is your intention in creating a
new instance of Main? Do you really want a new object? Or (since you originally asked about accessing members of that main class) did you only do this as an attempt to get to "charpick"?
Generally speaking (as Randall pointed out), a main method should do nothing more than kick things off. For example, create an object and then call some method on that object. From the code you posted, it looks like your instance of "Main" is supposed to represent a player. If that's the case, maybe you want to consider making Player a separate class.
But I think the key to your question is
making references to these objects available where they are needed. For example, something like...
Then just use your main method to create an instance of "SomeClass" (maybe it's "Game"?) and kick things off.