-
-
Save harageth/ff8d1764eeb4036c2741609200419a43 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package passByReference; | |
public class blah { | |
public static void main(String[] args) { | |
passByReference value = new passByReference(2); | |
System.out.println(value.value); | |
changeValueByReference(value); | |
System.out.println(value.value); | |
} | |
private static void changeValueByReference(passByReference val) { | |
val.value = 5; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment