+ 1
Sizeof method alternative in java
Sizeof method does not exists in java.I just wanna know if we can find the size of integer or float by means of any program??.I think integer occupies four bytes.How can one show it like we do in c++ using sizeof method ????
4 Answers
+ 12
Afaik you don't need the sizeof stuff, because Java uses constant sizes (32-/64-bit).
+ 2
@Tashi N
Yes I know in java they are constant.
Just wanna know if there is a way to prove int has four bytes by means of a program.
+ 2
Thanks a lot for helping me out.
I really don't want to memorize these size of primitive data types.