C# Return Statement Explained: Complete Guide
In C#, the return statement is used to exit the current method and return a value. It can return a value, an object, or nothing (void), depending on the method’s signature. When returning a value, it must be compatible with the declared return type. In methods with no return value, the return statement can be used to prematurely terminate the method.