+ 1

Are method names custom?

In C#, there always has to be a Main method, but otherwise are names chosen in the same way as variable names (like, custom by the coder) or are they "preset" and I just haven't got that far yet? Sorry for the basic question, I'm super new to... everything 😅

10th Oct 2017, 9:23 AM
Violet
Violet - avatar
2 Answers
+ 4
Custom is fair. There are certain rules some hard and some not so hard. Like in C# method names start with capital letters follow that "CamelCase" idea. You can't start with a number and the name must be unique per class. And if the parent class (super class) already had a method with that name then you're most likely overriding in your class. There is probably more to it than that but I try to keep it simple.
10th Oct 2017, 10:46 AM
Dark Angel
Dark Angel - avatar
+ 4
The main method serves as the program entry point and it's quite common in various languages. 😉
10th Oct 2017, 4:01 PM
Zephyr Koo
Zephyr Koo - avatar