Java's primitive data types are very similar to those of C. They include boolean, byte, short, int, long, float, double, and char. The boolean type has been added. However the implementation of the data types has been substantially cleaned up in several ways.
int
)
Java specifies everything.sizeof
isn't necessary in Java because all sizes
are precisely defined. For instance, an int
is always
4 bytes. This may not seem to be adequate when dealing with objects
that aren't base data types. However even if you did know the size
of a particular object, you couldn't do anything with it anyway.
You cannot convert an arbitrary object into bytes and back
again.