Overview - Return values and void methods
What is it?
In C#, methods are blocks of code that perform tasks. Some methods give back a result when they finish, called return values. Others do not give back anything and are called void methods. Return values let you use the result elsewhere in your program, while void methods just do something without sending anything back.
Why it matters
Return values let programs communicate results between different parts, making code reusable and organized. Without return values, you would have to repeat code or use confusing workarounds. Void methods are useful when you want to perform actions like printing or changing something without needing a result. Together, they help build clear and efficient programs.
Where it fits
Before learning this, you should know what methods/functions are and how to write basic code blocks. After this, you can learn about method parameters, overloading, and how to use return values in more complex ways like chaining or recursion.