Return
A return statement returns control from a function or method back to its caller.
Related concepts: FunctionMethodCallControl Flow
Closest Wikipedia entry: Return statement — In computer programming, a return statement causes execution to leave the current subroutine and resume at the point in the code immediately after the instruction which called the subroutine, known as its return address. The return address is saved by the calling routine, today usually on the process's call stack or in a register. Return statements in many programming languages allow a function to specify a return value to be passed back to the code that called the function.
Misconceptions about Return15 documented Misconceptions
Check YourselfConstructorReturnsObject
Constructors need to return objectsDeferredReturn
A return statement in the middle of a method doesn't return immediatelyReturnCall
Return statements need () around the return valueReturnUnwindsMultipleFrames
A return statement can unwind multiple call stack framesUseOfSelfTypeImpliesRecursiveType
If a class has a method that has a local variable, parameter, or return value with the class as its type, the class is a recursive typeVoidMethodReturnsValue
A method with void return type can return a value