So, that’s why I need to understand what he means by passing by reference. Actually everything is passed by certain kind of “value”. It could be the actual value (primitive), the value of a an object reference, the value of a reference to a primitive, or the value of a reference to an object reference. It depends on how many indirections between something passed to a function and the corresponding actual object/primitive.
Java/Kotlin does not support pass by reference as in C++ using the & declaration. So, you cannot pass a reference to a function and allow the function to modify the value. Passing by reference is general considered a bad design, so Java did not provide the feature right at the beginning and neither does Kotlin. I don’t think it is a good idea to