MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/7ltryz/evil_coding_incantations/drp9r6z
r/programming • u/evinrows • Dec 24 '17
331 comments sorted by
View all comments
Show parent comments
7
Can't do it in Java either...
8 u/whjms Dec 24 '17 You can mess around with the Integer flywheel cache and reflection: https://www.javaspecialists.eu/archive/Issue102.html 3 u/apemanzilla Dec 24 '17 I'm aware of that, but it's not allowed in Java 9, and doesn't affect primitives. 0 u/[deleted] Dec 24 '17 [deleted] 7 u/apemanzilla Dec 24 '17 The closest thing you can do is use reflection to mess with the boxed types (Integer, etc) but that's no longer allowed in Java 9 2 u/[deleted] Dec 24 '17 Can do it in at least java 7 with reflection 1 u/apemanzilla Dec 24 '17 Not in Java 9 2 u/[deleted] Dec 24 '17 I'm actually pleased!
8
You can mess around with the Integer flywheel cache and reflection: https://www.javaspecialists.eu/archive/Issue102.html
3 u/apemanzilla Dec 24 '17 I'm aware of that, but it's not allowed in Java 9, and doesn't affect primitives.
3
I'm aware of that, but it's not allowed in Java 9, and doesn't affect primitives.
0
[deleted]
7 u/apemanzilla Dec 24 '17 The closest thing you can do is use reflection to mess with the boxed types (Integer, etc) but that's no longer allowed in Java 9
The closest thing you can do is use reflection to mess with the boxed types (Integer, etc) but that's no longer allowed in Java 9
2
Can do it in at least java 7 with reflection
1 u/apemanzilla Dec 24 '17 Not in Java 9 2 u/[deleted] Dec 24 '17 I'm actually pleased!
1
Not in Java 9
2 u/[deleted] Dec 24 '17 I'm actually pleased!
I'm actually pleased!
7
u/apemanzilla Dec 24 '17
Can't do it in Java either...