Skip to content

Instantly share code, notes, and snippets.

@harageth
Created September 21, 2017 20:12
Show Gist options
  • Save harageth/ff8d1764eeb4036c2741609200419a43 to your computer and use it in GitHub Desktop.
Save harageth/ff8d1764eeb4036c2741609200419a43 to your computer and use it in GitHub Desktop.
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