That would just be:
Console.WriteLine(Variables.name);
and it needs to be public also:
public class Variables
{
public static string name = "";
}
More Related Contents:
- When to use static classes in C# [duplicate]
- Static vs non-static class members
- Use dependency injection in static class
- C# static class constructor
- ASP.NET C# Static Variables are global?
- What’s the use/meaning of the @ character in variable names in C#?
- Instance variables vs. class variables in Python
- What does the @ symbol before a variable name mean in C#? [duplicate]
- What is the difference between an interface and a class, and why I should use an interface when I can implement the methods directly in the class?
- Is the order of static class initialization in C# deterministic?
- Are static class instances unique to a request or a server in ASP.NET?
- Are static methods thread safe
- Static Indexers?
- Should C# methods that *can* be static be static? [closed]
- .Contains() on a list of custom class objects
- A list of multiple data types?
- How does creating a instance of class inside of the class itself works?
- How to access page controls inside a static web method? [duplicate]
- How can I get the value of a session variable inside a static method?
- Which is best for data store Struct/Classes?
- Importing CSV data into C# classes
- C# – static types cannot be used as type arguments
- How to implement virtual static properties?
- Why must an C# interface method implemented in a class be public?
- Do static members of a class occupy memory if no object of that class is created?
- C# – Can publicly inherited methods be hidden (e.g. made private to derived class)
- C# – How to check if namespace, class or method exists in C#?
- How does HttpContext.Current work in a multi-threaded environment?
- Partial class in different namespaces
- how to get newtonsoft to deserialize yes and no to boolean