in reply to Re^9: The fallacy of the *requirement* for read-only instance variables.
in thread The fallacy of the *requirement* for read-only instance variables.
But since you can't do 3 = 5;, or modify the number 3 in any other way, numbers are immutable.By the same logic, strings are immutable. "3" = "5"; is as immutable as 3 = 5;. I will buy both both strings and number are immutable and both strings and numbers are mutable (the former when talking about literals - the latter when talking about values of variables). But I won't accept your original statement numbers are immutable, strings are not - at least not until you have some reasoning that convinces me.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^11: The fallacy of the *requirement* for read-only instance variables.
by moritz (Cardinal) on Apr 18, 2011 at 12:44 UTC | |
by JavaFan (Canon) on Apr 18, 2011 at 14:34 UTC | |
by BrowserUk (Patriarch) on Apr 18, 2011 at 12:50 UTC |