Why the output is hello in this code?🤔 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 15

Why the output is hello in this code?🤔

My code is given below: https://code.sololearn.com/cIUlmqC3sIs6/?ref=app Console.WriteLine is already exist .So why this code is not giving any error nor printing 5? Why the answer is hello?

8th Sep 2020, 5:43 PM
The future is now thanks to science
The future is now thanks to science - avatar
4 Answers
+ 4
Your object's name and the method have overridden the actual printing statement! So, instead of calling the system's already defined method to print things, it is calling the class you have made!
8th Sep 2020, 6:20 PM
Namit Jain
Namit Jain - avatar
+ 4
WriteLine is a reserved word in C#🙄 https://code.sololearn.com/cr591sVUbXDE/?ref=app
10th Sep 2020, 6:25 AM
Sanjay Kamath
Sanjay Kamath - avatar
0
There is hello written in the code
9th Sep 2020, 7:26 AM
Prajeet Sam
Prajeet Sam - avatar
0
See carefully
9th Sep 2020, 7:26 AM
Prajeet Sam
Prajeet Sam - avatar