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
What is the map interface?
What is an abstract method?
Explain how will the struts know which action class to call when you submit a form?
Can I import same package/class twice? Will the jvm load the package twice at runtime?
Brief description about local interfaces?
Which container method is used to cause a container to be laid out and redisplayed?
How substring() method of string class create memory leaks?
how do you Handle Front End Application data against DB with example?
Define the remote object implementation?
Why are component architectures useful?
What is message driven beam?
What is RMI and what are the services in RMI?
What is glasgow?
wahts is mean by dynavalidatorform in struts/
Are there books about seam?