Return Type

noun

say it: “rih-TURN type” /rɪˈtɜːrn taɪp/

The type of value a method promises to send back, written before its name, or void if it sends nothing.

What is Return Type in C#?

Return Type — The type of value a method promises to return.

class OrderCalculator
{
    int Total(int price, int quantity = 1)
    {
        return price * quantity;
    }
}

In a sentence

  • “The return type of AddTax is decimal, so I can store its answer in a decimal.”

Level: Apprentice · More C# terms at this level

Updated

In other subjects