Which are valid c# name | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Which are valid c# name

11th Feb 2017, 2:55 AM
Dron Payel
Dron Payel - avatar
2 Answers
+ 5
Variables, method and class names, and other identifiers can only contain uppercase/lowercase letters, numbers, and underscores. They cannot contain spaces, or symbols besides underscores. Keywords cannot be used as names (Ex: int, class, for, etc.) They must start with a letter or underscore, and can't start with a number. Starting with an underscore is not recommended. Exs: firstName, num2, input_word, GetAns()
11th Feb 2017, 5:21 AM
Tamra
Tamra - avatar
0
thanks
11th Feb 2017, 5:30 AM
Dron Payel
Dron Payel - avatar