why there is no output? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

why there is no output?

class Program { static void Main(string[] args) { Test one = new Test(33); Console.Read(); } } class Test { public const int x = 3; public readonly int y; public Test(int yy) { this.y = yy; } public void Method(int x, int y) { Console.WriteLine(x); Console.WriteLine(y); } }

6th Aug 2017, 2:06 PM
Raffi Ohannesian
Raffi Ohannesian - avatar
2 Answers
+ 5
Because you never called Method(), so nothing will be output.
6th Aug 2017, 2:19 PM
Hatsy Rei
Hatsy Rei - avatar
+ 1
yes !
6th Aug 2017, 4:00 PM
Raffi Ohannesian
Raffi Ohannesian - avatar