Let me start by saying that working with public variables is considered bad programming, especially if they aren't made static so they can be changed from outside the class they are defined in.
The 'correct' way of doing this, of course, is defining a method in class 2 to tell you the value of the variable and - if necessary - change it also.
This being told, simply add the modifier public to the variable declaration. An example in http://www.glenmccl.com/tip_002.htm. That's a rather acceptable way of organising this: put all 'globals' in one module to define them.
Here's my question, how do I call up variables that have been declared and initialized in one class in another operate class. Or more simply how do I create public variables. I am going to provide a fake yet useful program to illustrate what I want, and what I have.
public class classOne
public static void main(String args)
String variableOne = "hello world";
What I want is the public class to be able to display the contents of the variable in classTwo. How do I make variableOne public? Thanks in advance