3 ms·
You can also do a similar thing in Java, as illustrated in this answer on CodeGolf stackexchange: https://codegolf.stackexchange.com/a/28818 https://codegolf.st
by tomsmeding 9y ago
You can also do a similar thing in Java, as illustrated in this answer on CodeGolf stackexchange: https://codegolf.stackexchange.com/a/28818 https://codegolf.stackexchange.com/a/28818
- leibnitz27 9y agoIndeed - the integer boxing cache is even required by the language spec! http://docs.oracle.com/javase/specs/jls/se8/html/jls-5.html#jls-5.1.7 http://docs.oracle.com/javase/specs/jls/se8/html/jls-5.html#... (here == means reference not value equality) "If the value p being boxed is an integer literal of type int between -128 and 127 inclusive (§3.10.1), or the boolean literal true or false (§3.10.3), or a character literal between '\u0000' and '\u007f' inclusive (§3.10.4), then let a and b be the results of any two boxing conversions of p. It is always the case that a == b."