As far as I know, when passing objects in Java,
This is a call-by-reference.
When passing a general variable (int, etc.),
I know it's Call by Value, is that right?
Is there a way to turn the general variable over to the reference?
Thank you
java
You must use the wrapper class.
It is wrapped in classes such as Integer and Long and delivered.
int i = 10;
Integer intObj = new Integer(i);
© 2024 OneMinuteCode. All rights reserved.