Card 03/ 10

ConceptDifficulty: Beginner1 min

Parameters Are Names; Arguments Are Values

Two words that get used as though they meant the same thing, until an error message uses one of them precisely and it stops making sense.

java
double vatOn(double amount) {
    return amount * 0.20;
}

double tax = vatOn(19.99);
The two words, and which line each one is about
WordWhere it livesIn the listing
ParameterIn the declarationamount — a name with a type, and nothing in it yet
ArgumentAt the call19.99 — an actual value, handed over

A parameter is a local variable that the method declares and the caller fills in. It exists only while the method runs, and its name is invisible to callers — renaming amount to net changes nothing outside the body.

The order matters and the names do not. transfer(from, to) and transfer(to, from) compile identically when both are the same type, which is why a method with three parameters of one type is a method waiting to be called wrongly.

Holding the distinction is what makes an error like "incompatible types: String cannot be converted to int" readable — it is telling you which argument failed to fit which parameter.