I am lost!i am so so lost !! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

I am lost!i am so so lost !!

I have been a good, smart boy so far but I am not understanding the following, both related to methods in c#, can someone plz make me understand static 'void' and 'string[]args' properly?! I can't progress further without understanding it...plz help!

14th May 2017, 12:04 PM
LôUis ToMilsøñ
LôUis ToMilsøñ - avatar
2 Answers
+ 4
static ... if you have a main.class and a math.class for example and you create an instance of the math class, you can access the methods inside of it. if your methods in math class are static, you can use them from main without creating an instance of the math class. Void is a return type. say you have this method. public int add(int x, but y){ int a=x+y; return a; } This has int instead of void which means it expects your method to return an integer. now this method public void add(int x, but y){ int a=x+y; } has a return type of void which means it expects to NOT have a return.
14th May 2017, 1:59 PM
LordHill
LordHill - avatar
+ 3
ty so much you guys...#lifeSaviours
14th May 2017, 2:40 PM
LôUis ToMilsøñ
LôUis ToMilsøñ - avatar