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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly