This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Overheads using short datatype Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Overheads using short datatype" Watch "Overheads using short datatype" New topic
Author

Overheads using short datatype

rakesh nagar
Greenhorn

Joined: Aug 02, 2001
Posts: 17
Hi there,
I have a requirement for declaring an int constant. The value of constant is less than 10. I am using short datatype for storing this constant value.
Could you please tell me if there are some performance overheads of using short over int datatype.
Thanks & regards,
Rakesh Nagar
------------------
Sean MacLean
author
Ranch Hand

Joined: Nov 07, 2000
Posts: 621
This seems like a good question for the knowledgable folks in the Performance forum, so I'm moving this question there.
Sean
 
wood burning stoves
 
subject: Overheads using short datatype
 
Similar Threads
Switch / case variable type
Overheads using short datatype
Casting
Narrowing conversion between char and byte or short
How would I do this in Java? Union to split unsigned int into two signed short's.