4
Answers

about class variables

jkjsha ahsa

jkjsha ahsa

15y
2.3k
1
i want to know if there is code i write befor class variables to make them all public or private or any access modifir
like this in c

class example
{
   public{ string m;
                int num;
             } // m and num are public
 }

this code is easir than these in c # as i write public once

the same code in c#:

class example{
 
public string m;
public int num;
                       }


in brief i want to know if there is code in c# don't make me to write the access modifier like "public" more than one time
Answers (4)