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

后端 未结 30 2476
北恋
北恋 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 02:05

    Oracle's Java tutorials define this distinction thusly: "Parameters refers to the list of variables in a method declaration. Arguments are the actual values that are passed in when the method is invoked. When you invoke a method, the arguments used must match the declaration's parameters in type and order."

    A more detailed discussion of parameters and arguments: https://docs.oracle.com/javase/tutorial/java/javaOO/arguments.html

提交回复
热议问题