return will return control from the current method to the caller, and also pass back any argument with it. In your example, GivePoints is defined to return an integer and accept the integer as an argument. In your example, the return value actually matches the value of the argument.
The return value is used from another code in your code that calls the given GivePoints method in this example.
int currentPoints = GivePoints(1);
means currentPoints gets a value of 1.
What this means is that GivePoints is rated. GivePoints based on what the method returns. GivePoints returns the input, so GivePoints will evaluate to 1 in the example above.
source share