Last active
July 7, 2022 22:32
-
-
Save vinimonteiro/beaa9bdb48baee73fbd556d68f7004f4 to your computer and use it in GitHub Desktop.
Pass by value immutable object
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 com.vinimo; | |
public class App { | |
public static void main(String[] args) { | |
String str = "Java is not dead"; | |
modify(str); | |
System.out.println(str); | |
} | |
public static void modify(String str) { | |
str = "Java is dead"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment