13 Replies
It can be non-static
IE, by removing the
static keywordstatic means that the method belongs to the Program class right?No
Static means you do not need to invoke the method on an instance
All methods inside
Program belong to Program, the question is whether you need an instance of Program to invoke themI can have a
Toilet is a static method, yes, but it belongs to the Skibidi class, not the Program classand
public i assume means that it can be invoked everywhere in the program
or other .cs files?Not just in the program, but also anything that references it
For example,
Console.WriteLine is a public method in a public class, that you're getting from .NETOk i hope i will understand these one day
i still mess up pretty badly
static void for example with public static
but its something normal
its easier than CUnknown User•7mo ago
Message Not Public
Sign In & Join Server To View
I'm removing ur purple
the pattern is essentially
[visibility] [static or nothing] <return type>
where void is a return type that means it doesn't return any data
there are some other keywords you can throw in the mix but they would just be confusing to bring up nowUnknown User•7mo ago
Message Not Public
Sign In & Join Server To View
I guess foo bar is out of fashion nowadays...