Private variable in method - C#

  • Thread starter Thread starter Arash_89
  • Start date Start date
A

Arash_89

Guest
Hello,

Why we cannot use private variable in methods?

Thanks

static void Main(string[] args)
{
private int a;
List<Person> list = new List<Person>()
{
new Person() { Entry = "Daniel"},
new Person() {ID = 10 , Entry = "Windows"}
};
}



1544497.jpg

Continue reading...
 
Back
Top