return

suggest change

Returns exits a method.

public int Sum(int valueA, int valueB)
{
    return valueA + valueB;
}

public void Terminate(bool terminateEarly)
{
    if (terminateEarly) return; // method returns to caller if true was passed in
    else Console.WriteLine("Not early"); // prints only if terminateEarly was false
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents