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

后端 未结 30 1899
北恋
北恋 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:40

    Let's say you're an airline. You build an airplane. You install seats in it. Then, you fill the plane up with passengers and send it somewhere. The passengers (or rather, some spatio-temporally altered version thereof) disembark. Next day, you re-use the same plane, and same seats, but with different passengers this time.

    The plane is your function.

    The parameters are the seats.

    The arguments are the passengers that go in those seats.

提交回复
热议问题