why do you have to assign yourName to a string? Couldn't you just leave the string out? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

why do you have to assign yourName to a string? Couldn't you just leave the string out?

15th Dec 2016, 2:25 AM
Vasiliy
Vasiliy - avatar
3 Answers
+ 1
C# require every variable to have a data type specified.
15th Dec 2016, 5:07 AM
Om On Look Out
Om On Look Out - avatar
0
Whats about the var keyword?
15th Dec 2016, 7:50 AM
Antischokke
0
Even if generic, var too is a data type, you can use var too.
15th Dec 2016, 7:53 AM
Om On Look Out
Om On Look Out - avatar