Why does java not need sizeof()

In C and C++, the sizeof() operator can tell you the number of bytes to allocate for a data item. In C and C++, the biggest reason to use sizeof() is for portability.
Java doesn't need sizeof(). All data types are the same size on all machines. We don't have to think about porting -- it's already designed into the language.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327089144&siteId=291194637