There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Bhairava Surya wrote:2. Why there is no ... Integer pool etc,
There are three kinds of actuaries: those who can count, and those who can't.
Piet Souris wrote:Indeed, and that's why expressions like
String s = "im";
s += "mutable";
are impossible in java ;)
"Il y a peu de choses qui me soient impossibles..."
Stevens Miller wrote:hanged in your favor, Piet. This works fine for me:
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
fred rosenberger wrote:
But remember..that doesn't CHANGE the original String. It creates a brand new String object and re-assigned s to refer to it.
"Il y a peu de choses qui me soient impossibles..."
There are three kinds of actuaries: those who can count, and those who can't.
Piet Souris wrote:Yes, it did not get the same attention as the lambda's, but nevertheless a useful addition in java 8...
"Il y a peu de choses qui me soient impossibles..."
Stevens Miller wrote:[(...) danged FP proselytizers always hog the spotlights. ..
There are three kinds of actuaries: those who can count, and those who can't.
Bhairava Surya wrote:I read the references shared here. After that also same question why only String class immutable. What are the specific advantages that we are getting with this.
Piet Souris wrote:
Yes, it did not get the same attention as the lambda's, but nevertheless
a useful addition in java 8...