Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAndrew Perry
5,266 Pointswhich 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
28,558 PointsC# 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.
Andrew Perry
5,266 Pointsah ok, thanks for that
MIAN OSAMA ARSHAD
Courses Plus Student 269 Pointsthe method you invoke first in method will invoke first
Steven Xu
3,493 PointsNo 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.