When to use primitive and when complex types in java

Posted by Gandalf StormCrow on Stack Overflow See other posts from Stack Overflow or by Gandalf StormCrow
Published on 2010-03-24T15:38:41Z Indexed on 2010/03/24 15:43 UTC
Read the original article Hit count: 257

Filed under:

Hello,

In which case should you use primitive types(int) or complex types(Integer)?

Ex:

http://stackoverflow.com/questions/2508918/why-java-compiler-does-not-like-integer-as-type-for-values-in-hashmap this example works with Integer type. Should we always use Integer as a complex type?

© Stack Overflow or respective owner

Related posts about java