+ 2

Can you name the method anything?

27th Apr 2016, 10:49 PM
John Stanton
5 odpowiedzi
+ 4
naming also have some rules... I think it can not begin with a number and special character. Name should be user friendly. for e.g. If you are creating a method to show largest even no among a group of numbers you can name your method : LargestEvenNumber.
30th Apr 2016, 4:45 AM
Umesh Kuniyal
Umesh Kuniyal - avatar
0
No you can't name the method "anything". there are c# reserved words that cannot be used. eg, u can't name a method "class" or "double" u also cannot start a method name with a number
26th Jun 2016, 12:32 PM
Nwonah Vincent
Nwonah Vincent - avatar
0
You actually can name your method "class" @Nwonah Vincent. Though you need to prefix it with a @
14th Jul 2016, 2:26 PM
LetSPlaYRagE23
LetSPlaYRagE23 - avatar
- 1
Yes you can, its always best to give your methods a meaningful name that represents its function.
30th Apr 2016, 5:53 PM
Steven Villa
Steven Villa - avatar
- 2
yes of cours !
1st May 2016, 6:17 AM
Mohamed Amine chater
Mohamed Amine chater - avatar