About 74,200 results
Open links in new tab
  1. java - String is immutable. What exactly is the meaning ... - Stack ...

    Jan 10, 2012 · Java String is immutable, String will Store the value in the form of object. so if u assign the value String a="a"; it will create an object and the value is stored in that and again if …

  2. What is difference between mutable and immutable String in java

    Aug 5, 2014 · Java Strings are immutable. In your first example, you are changing the reference to the String , thus assigning it the value of two other Strings combined: str + " Morning" . On …

  3. Immutability of Strings in Java - Stack Overflow

    String class is immutable, and you can not change value of immutable object. But in case of String, if you change the value of string than it will create new string in string pool and than …

  4. java - What is meant by immutable? - Stack Overflow

    Nov 11, 2008 · Why are string objects immutable in java? Because Java uses the concept of string literal. Suppose there are 5 reference variables, all refers to one object "Future".If one …

  5. Is a Java string really immutable? - Stack Overflow

    Jan 6, 2014 · It is a certain property of Java String literals that they are automatically interned, i.e. cached. Two String literals with the same value will actually be the same object. When you …

  6. Why is String immutable in Java? - Stack Overflow

    Mar 14, 2014 · When a string is created and if the string already exists in the pool, the reference of the existing string will be returned, instead of creating a new object and returning its …

  7. What's the advantage of a String being Immutable?

    Jan 30, 2013 · a) Imagine StringPool facility without making string immutable , its not possible at all because in case of string pool one string object/literal e.g. "Test" has referenced by many …

  8. java - Examples of immutable classes - Stack Overflow

    Nov 22, 2011 · Immutable class is a class which once created, it’s contents can not be changed. Immutable objects are the objects whose state can not be changed once constructed. …

  9. java - Is "new String ()" immutable as well? - Stack Overflow

    Jan 27, 2014 · The primary reason that Java String is designed as an immutable class is simplicity. It makes it easier to write correct programs, and read / reason about other people's …

  10. Java Explain: why String immutable make StringBuffer MORE …

    Mar 28, 2012 · Because a String is immutable, using StringBuffer is more efficient. I understand that String instances are immutable. I also understand that StringBuffer makes processing …

Refresh