Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

data types

 
David raja
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i make print the size of a data type in java? like the sizeof function in C?
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't, except by hacky and unreliable methods. However, there are VERY few valid reasons for needing it. Why do you want it?

Search the forums for "sizeof" for more discussion.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12146
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
to quote Bert and Kathy, "Java is NOT C".

there are many things you can do in C that you can't do in java. and mostly, that's a good thing. Many of the things Sun got rid of are the things that caused all KINDS of headaches.

If you have a problem you're trying to solve, post that and we can help you find a good way to do it.

if you are just curious, well, sometimes there are little mysteries in live that we won't ever solve.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic