0
public static void main (string[ ] args) i have understood little bit that public means for whole method. static? void? main is a method which creates a string array named args. why the name args? please explain and correct if i am wrong?
3 Réponses
+ 1
public means that the method you are going to create has public access i.e this method can be accessed by any other class.
static means that this method is same for all objects of that class and can be called or used without creating objects of that class.
.
void means that it has no return type which means that when it will be called it will not return any value to the calling statement.
main is the name of the method.
string args[] means that this method requires parameter of type string. [] symbol means you are making an array .
args is the name of the array of string and it depends on you to choose a name. you can give it any name.
for eg. a[] , hell[] , boy[] , game[] etc.
0
args [] is a string array that is used for command line arguments ,void is because it doesn't return a value
0
public means that the method you are going to create has public access i.e this method can be accessed by any other class.
static means that this method is same for all objects of that class and can be called or used without creating objects of that class.
.
void means that it has no return type which means that when it will be called it will not return any value to the calling statement.
main is the name of the method.
string args[] means that this method requires parameter of type string. [] symbol means you are making an array .
args is the name of the array of string and it depends on you to choose a name. you can give it any name.
for eg. a[] , hell[] , boy[] , game[] etc.