String is immutable.it is true
String can be change to mutable How?
Answer Posted / java
String s = "PROJECT";
String s2 = s.toLowerCase();
System.out.println(s.equals("PROJECT")); // Prints true
System.out.println(s.equals(s2)); // Prints false
In comparison, consider what would happen if Strings were mutable.
MutableString ms = "PROJECT";
MutableString ms2 = ms.toLowerCase();
System.out.println(ms.equals("PROJECT")); // Prints false
System.out.println(ms.equals(ms2)); // Prints true
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Can constructors be synchronized in java?
What value does read() return when it has reached the end of a file?
difference between ejb,struts,hibernate,spring and jsp
What are local interfaces? Describe.
What is the difference between session and entity beans?
Is the infobus client side only?
Explain about RMI Architecture?
How would you detect a keypress in a jcombobox?
What are the different algorithms used for clustering?
Where can I ask questions and make suggestions about seam?
Can I use javascript to submit a form?
What is synchronization and why is it important?
what is handle?
In our urls and in the text of the buttons we have comma. Its causing an error. Is there a way to change the delimiting character for the menu arguments?
Brief description about local interfaces?