Question d’entretien chez Apple

Is Java pass-by-value or pass-by-reference?

Réponses aux questions d'entretien

Utilisateur anonyme

26 févr. 2016

Actually, everything in Java is pass-by-value. Objects are not passed by reference, but rather, object references are passed by value. In a language like Java that has no such thing as a dereference, this is a subtle but important distinction. I'm usually wary in interviews when the interviewer tries to push these sorts of subtle "gotchas" in an interview when really a coding example will show whether or not you understand the underlying concept rather than the nitpicky vocabulary.

6

Utilisateur anonyme

9 janv. 2016

Scalars are passed by value while objects are passed by reference