Link to home
Start Free TrialLog in
Avatar of dshi15
dshi15Flag for United States of America

asked on

variable scope in C#

Hi Expert,

How I can access test value in Other class?
class Program
    {
       
        static int test= 0;

        public Program()
        {
           
            test = 10;
        }


	public static void Main()
        {

         }

}


Class Other

{
 int i =Program.test 

}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Russ Suter
Russ Suter

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial