Why it don't works? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why it don't works?

I wrote the same code like in tutorial, but I get error. Why? namespace SoloLearn { class Program { static void sayHi() { Console.WriteLine("Hi"); } static void Main(string[] args) { sayHi; } } }

22nd Apr 2017, 10:23 AM
Wanzet 222
Wanzet 222 - avatar
9 Answers
+ 23
use sayHi() in main().
22nd Apr 2017, 10:26 AM
Shamima Yasmin
Shamima Yasmin - avatar
+ 9
function requires "()" at the end. this means you cannot write sayHi; You need to write sayHi();
22nd Apr 2017, 10:28 AM
Cyrus Ornob Corraya
Cyrus Ornob Corraya - avatar
+ 8
No problem, just learn from mistakes.
22nd Apr 2017, 10:35 AM
Cyrus Ornob Corraya
Cyrus Ornob Corraya - avatar
+ 7
#understood not understanded.
22nd Apr 2017, 10:30 AM
Cyrus Ornob Corraya
Cyrus Ornob Corraya - avatar
+ 3
Thanks
22nd Apr 2017, 10:27 AM
Wanzet 222
Wanzet 222 - avatar
+ 3
Thanks, I already understanded :D
22nd Apr 2017, 10:29 AM
Wanzet 222
Wanzet 222 - avatar
+ 3
Remember it like this: A guy wants to get some eggs, so he goes to the store and sees their shape (); Lol sorry that's all I can think of.
22nd Apr 2017, 12:23 PM
Xander A.
Xander A. - avatar
+ 2
Ahahaha. What a mistake
22nd Apr 2017, 10:27 AM
Wanzet 222
Wanzet 222 - avatar
+ 2
Ok, sorry, I'm from Russia, so sometimes I make orthography mistakes)
22nd Apr 2017, 10:34 AM
Wanzet 222
Wanzet 222 - avatar