Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

java switch

Name: Anonymous 2011-10-20 11:32

Why does java not allow String objects to be used in the switch/case statements? Couldn't the compile invoke hashcode() on those strings thus producing a unique integer value to represent the constant in the cases?

Name: Anonymous 2011-10-22 13:38

>>48
actually in Java you can mutate closed over variable by putting them in a final array of size 1 and mutating the content of that array. (try it; it works) final just means that the variable can't be rebound, not that the value is immutable.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List