Content received from: http://JavaFAQ.nu/java-article41.html


Question: Java has no sizeof() like C++... Why?
Tuesday, January 28, 2003 (00:00:00)

Posted by jalex

Question: Java has no sizeof() like C++... Why?

Answer: In C and C++ the sizeof() tells the number of allocated bytes for data items. Different machines and OSs can allocate different number of bytes for the same data. For example integer can be stored in 16 or 32 bits.

That's why important to know for programmer this information.
Java is much better in this situation since it keeps the same size on all machines.
The portability is a part of language and you should not worry about this - just know it!
--
Sasha
******************************************************************
Our older tips: March 22, 2001 - Oktober 21, 2002 read here.
All published and not published on site tips you can find here