0

I do know that values in Java are passed by value.

resources:

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

https://www.journaldev.com/3884/java-is-pass-by-value-and-not-pass-by-reference [...]

Just wanted to know if after introduction of method references (::) Java is still considered as passed by value.

miroana
  • 494
  • 3
  • 22
  • 3
    "Reference" in "method reference" and in "pass by reference" does not hold the same meaning. It's all pass by value whether the invocation of a method follows a method reference or not. – ernest_k Jan 28 '22 at 07:42
  • 1
    References in Java are also passed by value. A method reference is just another type of reference. It doesn't change how anything is passed in Java (by value) – Erwin Bolwidt Jan 28 '22 at 07:51
  • A method reference isn’t passed by anything. It’s syntactic sugar for a lambda (ish) and desugars to a `static` method invoked by `invokedynamic` (ish). – Boris the Spider Jan 28 '22 at 07:57

0 Answers0