C# C# Basics (Retired) Prepare and Plan Program Structure

which methods come first after Main()?

so the static Main() method is executed first but how does c# decide which methods are executed next after that?

4 Answers

andren
andren
28,359 Points

C# itself never executes any method besides Main automatically, once it executes Main you (the coder) is the one responsible for calling other methods explicitly. If you don't call any methods within Main then C# will just exit the program once it reaches the end of the Main method.

ah ok, thanks for that

the method you invoke first in method will invoke first

Steven Xu
Steven Xu
3,493 Points

No requirement for which method will come next. But you need to make sure that all methods you call in Main() will list in no particular order down below.