FAQ Database Discussion Community


String count in the pool with println

java,string,string-pool
I am preparing for the OCA SE 7 exam, and some of these questions are really (!) tricky. In one of the books Im using I found an error I think, so I would like to confirm the following please... public static void main(String... args) { String autumn = new...

Is this compromise to string immutablity in java? [duplicate]

java,string,immutability,string-pool
This question already has an answer here: Is a Java string really immutable? 13 answers All of us know that String is immutable in java - content can not be changed once the string is created. String uses character array char[] value to store string content, here is the...