Calling a Variable from another Class

Viewed 237315

How can I access a variable in one public class from another public class in C#?

I have:

public class Variables
{
   static string name = "";
}

I need to call it from:

public class Main
{
}

Thanks in advance for the help.

I am working in a Console App.

4 Answers
class Program
{
    Variable va = new Variable();
    static void Main(string[] args)
    {
        va.name = "Stackoverflow";
    }
}
Related