Method Parameter

noun

say it: “METH-ud puh-RAM-ih-ter” /ˈmɛθəd pəˈræmɪtər/

A named input listed in a method's parentheses, with its type, that the caller fills with a value.

What is Method Parameter in C#?

Method Parameter — A named input declared by a method.

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

In a sentence

  • “AddTax has one parameter, decimal price, so the caller passes in the price.”

Level: Apprentice · More C# terms at this level

Updated

In other subjects