Card 10/ 10
All 10 cards
RecapDifficulty: Intermediate1 min
What a Method Can Change for Its Caller
Five things this topic established, and where each one was.
| The thing | Where |
|---|---|
| A signature has five parts, and only the parameter list decides which method a call matches | Reading a Method Signature From Left to Right |
| A parameter is a name in the declaration; an argument is a value at the call | Parameters Are Names; Arguments Are Values |
| Java passes everything by value, and a reference is a value | Java Copies Everything You Pass |
| Mutating through the reference reaches the caller; reassigning the parameter does not | A Method That Hands You a Different Order |
| Overloading resolves on the parameter list, never on the return type | What Overloading Resolves On, and What It Ignores |
A method can change the object you gave it and can never change the variable you gave it. Anything a method needs to hand back, it hands back by returning it.