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
Have you used threads in Servelet?
what are memory considerations of jsp compares to other web components?
What is the relation between the infobus and rmi?
Explain what is orm?
What is the argument type of a programs main() method?
whats is mean by tiles in struts
Which containers use a border layout as their default layout?
what is a non-repeatable read?
In inglish: How to convert jar to exe files? Em português: Como converter arquivos .jar para .exe?
What is bean? Where can it be used?
How a component can be placed on Windows?
What is the difference between ear, jar and war file?
What is a class loader?
How would you reatach detached objects to a session when the same object has already been loaded into the session?
Which are the different segments of memory?