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
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 metaspace?
What are local interfaces? Describe.
What is the map interface?
Do you think that java should have had pointers?
Which class is the immediate superclass of the menucomponent class?
What is in-memory replication?
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?
What is the relation between the infobus and rmi?
what are the advantages of JTA over JTS?
What is meant by method chaining?
What are the pros and cons of detached objects?
What is threadfactory?
what is a portable component?
what are getters and setters in Java with examples?