4
Answers

Confusion over use of static keyword

upendra Girish

upendra Girish

15y
5.6k
1
Hi All - my first post here - pls dont shoot me :D

Since static functions can access only static variables, how is it that we can use non-static variables inside Main() which is also declared as - public static void Main(string[] args) ?

ex - public static void Main(string[] args)
{
 int i; // how can this be used ? its not a static variable !
//...........etc...

}
Answers (4)