Objects: Instances of Classes

AP Computer Science A· difficulty 4/5

Java passes arguments by

  • A

    Pointer — addresses are passed and dereferenced

  • B

    Reference — modifications to parameters propagate to the caller

  • C

    Default to reference, with pass-by-value optional

  • D

    Value — for primitives, the value; for objects, a copy of the reference

    check_circle

Explanation

Java is strictly pass-by-value. Object references are values; the called method gets a copy of the reference, can mutate the pointed-to object but cannot reassign the caller's variable.

Want 10 more like this — adaptive to your weak spots?

Related questions