Objects as Parameters Flashcards
1
Q
1) Parameter passing by reference
As well as passing b______ data types we can also pass o______ as parameters.
A
basic
objects
2
Q
2) Do we pass the whole object?
A
No!
Whole objects can get quite large.
Instead, we pass in the address of an object, that is, its ‘reference’. Hence, passing parameters by reference.
e.g. Product myProduct;