I know that strings are immutable, but how this work
String s1 = "Java";
System.out.println(s1.toUpperCase()); //will show in capital
String s2="Stack overflow";
s2.toUpperCase();
System.out.println(s2); //won't show in capital
I know that strings are immutable, but how this work
String s1 = "Java";
System.out.println(s1.toUpperCase()); //will show in capital
String s2="Stack overflow";
s2.toUpperCase();
System.out.println(s2); //won't show in capital