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 if the static modifier is removed from the signature of the main method?
How substring() method of string class create memory leaks?
What is bean? Where can it be used?
What is message driven beam?
What is clustering? What are the different algorithms used for clustering?
Should synchronization primitives be used on bean methods?
how to use debug in my elipse to solve problems that exist in my project
Is the session factory thread safe?
What is meant by method chaining?
What is a policy?
Why a client should be multithreading? Explain.
hi friends, i have done my BE(CSE)at 2011 then i have joined one company before they asked me 50k so i paid but now they telling no project here so we r going to close like that so now i need any job i have good knowledge in core java and j2ee(jsp,servlet,jdbc) so if u know any job pl help me
What is the diffrence between a local-tx-datasource and a xa-datasource? Can you use transactions in both?
How a component can be placed on Windows?
Can you control when passivation occurs?