© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•5mo ago•
22 replies
Hampta

✅ Why and How does this work?

using System;

public class Program
{
    static void Main(string[] args)
    {
        Welcome();
    }
    static void Welcome() 
    {
        Console.WriteLine("Welcome");
        Console.WriteLine("I am a method");
        Console.WriteLine("End of method");
    }
}
using System;

public class Program
{
    static void Main(string[] args)
    {
        Welcome();
    }
    static void Welcome() 
    {
        Console.WriteLine("Welcome");
        Console.WriteLine("I am a method");
        Console.WriteLine("End of method");
    }
}


why does this work? when i think of code, i think of line to line declaration, so id think Main() runs furst, and then the method. so why is this?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

why does this Not work?
C#CC# / help
3y ago
❔ Why does this not work?
C#CC# / help
3y ago
❔ ✅ Why does this not work???
C#CC# / help
3y ago
why does this code not work???
C#CC# / help
3w ago