• Post Reply Bookmark Topic Watch Topic
  • New Topic

Using Long or long, Integer or int in as properties in beans?  RSS feed

 
Sven Anderson
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm wondering if there are good reasons for using wrappers such as Long instead of long and Integer instead of int when declaring property types in beans or domain objects? When I've been looking at other examples/bits of code
it seems that most of them prefer using Wrapper classes instead of primitive data types. Doesn't object types take up more memory? it must be more efficient to use primitives.

Many thanks for your feedback
S
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16058
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"swedstar", please check your private messages. You can see them by clicking My Private Messages.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!