Mercurial > hg > Blog
comparison content/Java/autoboxing.md @ 96:57988fb9567c
The link to the java autoboxing problems was dead. Use a new one that describes the problem better.
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Wed, 24 Jul 2019 08:29:42 +0200 |
parents | 4cd9b65e10e4 |
children |
comparison
equal
deleted
inserted
replaced
95:ef1a3397bd90 | 96:57988fb9567c |
---|---|
3 Tags: JDK | 3 Tags: JDK |
4 Lang: en | 4 Lang: en |
5 | 5 |
6 Autoboxing appeared first with JDK5 and lots of people go crazy about it. At first look it's a nice feature but the more you play with it the more I'm coming to the conclusion that the autoboxing implementation just sucks. | 6 Autoboxing appeared first with JDK5 and lots of people go crazy about it. At first look it's a nice feature but the more you play with it the more I'm coming to the conclusion that the autoboxing implementation just sucks. |
7 | 7 |
8 I will not rant about autoboxing pitfalls [that others have described already](http://www.certpal.com/blogs/2009/08/autoboxing-unboxing-gotchas/) but instead I'd like to point out my favourite autoboxing fail that alone is the reason not to use it: the `IntegerCache`. | 8 I will not rant about autoboxing pitfalls [that others have described already](https://effective-java.com/2010/05/the-advantages-and-traps-of-autoboxing/) but instead I'd like to point out my favourite autoboxing fail that alone is the reason not to use it: the `IntegerCache`. |
9 | 9 |
10 Consider this code snippet: | 10 Consider this code snippet: |
11 | 11 |
12 :::java | 12 :::java |
13 Integer value = 1; | 13 Integer value = 1; |