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 trialbohboh00
2,545 PointsStatic Void meaning in C#?
Hi, I may have missed the point when it was explained before, but I can't understand what "static void" means; can someone explain? Thanks
1 Answer
andren
28,558 PointsBoth of those are somewhat complex topics that are intentionally not explained in too much detail at this point in the course. As they pretty much require you to understand some concepts that you have not been taught yet and are therefore not really part of the "basics" this course is intended to teach. The void part will make more sense after learning more about how methods work, and static is even more complex and requires a decent understanding of how classes and objects work.
I'll give you an answer as to what they are but it likely won't help you too much at the moment.
void is a return type, it tells C# that the Main method does not return any value. Now what does it mean when I say return a value? That is where the knowledge of methods come in, I recommend you just wait until methods are covered in more detail in the course, you will be thought more about returning values and the various return types at that point.
static as mentioned above is even more complex, the simple answer is that it allows you to access a method directly from a class without needing to create an instance of it. If that answer does not mean much to you then that is completely fine, as you have not been taught a lot about classes or instantiation yet, but these are all things that will start to make sense as you get farther into the course.
If you really want me to go into more detail on those topics then I can write a more detailed answer, but I really would recommend that you just wait a bit and let the course explain these topic at its own pace, as it will likely be easier for you to follow along that way.
Senith Malavige
463 PointsSenith Malavige
463 PointsCan you explain it more easily...like from few words...? because it still harder to understand