c# get variable from another class
// Access variables between different classes
class ClassA
{
public static int num = 0;
static void Main(string[] args)
{
Console.WriteLine(num);
}
}
class ClassB
{
private static int newNum = ClassA.num;
public static void Method()
{
Console.WriteLine(newNum);
}
}