What's the difference between an argument and a parameter?

后端 未结 30 1881
北恋
北恋 2020-11-22 01:08

When verbally talking about methods, I\'m never sure whether to use the word argument or parameter or something else. Either way the other people know what

30条回答
  •  孤独总比滥情好
    2020-11-22 01:46

    I thought it through and realized my previous answer was wrong. Here's a much better definition

    {Imagine a carton of eggs: A pack of sausage links: And a maid } These represent elements of a Function needed for preparation called : (use any name: Lets say Cooking is the name of my function).

    A Maid is a method .

    ( You must __call_ or ask this method to make breakfast)(The act of making breakfast is a Function called Cooking)_

    Eggs and sausages are Parameters :

    (because the number of eggs and the number of sausages you want to eat is __variable_ .)_

    Your decision is an Argument :

    It represents the __Value_ of the chosen number of eggs and/or sausages you are Cooking ._

    {Mnemonic}

    _" When you call the maid and ask her to make breakfast, she __argues_ with you about how many eggs and sausages you should eating. She's concerned about your cholesterol" __

    ( Arguments , then, are the values for the combination of Parameters you have declared and decided to pass to your Function )

提交回复
热议问题