Its a conceptual question. But I would like to use the right term at the right place. That is why I would like to read some other views on this.
What is the difference between a variable and a parameter?
java;variables;parameters
In layman's words:Imagine a function as a black box.You don't know how the black box worksYou only know what the black box does, but not howThe black box needs something to work on, that you must provideThe black box gives you something in returnThat thing you provide the black box is a parameterThe pieces of information you don't know of, that the black box uses to do it's work, are variablesBut hey!, for you (the caller), the thing you give the black box can be a variable of your own, that you use to do your own work.You can also give the black box a literal, i.e, instead of passing it the variable personName you could pass it Peter. The black box doesn't know whether you passed it a variable or a literal. Once inside the black box, it's a variable as seen from the perspective of the black box.Finally the black box gives you something back, which is called a return value, which you can put in a variable or your own, or not, or you can pass to another box as a parameter.Some black boxes don't need you to pass them anything.Some black boxes don't return anything, and people call them methods.Some people call parameters arguments.