Each Java variable or expression has a definite type. Simple types such as integers or booleans are built-in. New composite types can be constructed in terms of classes, arrays and interfaces.
-
Note booleans are either TRUE or FALSE -- they are not 0, 1 ,-1 ...
|
There are 4 integer types: byte, short, int, long of size 8, 16, 32 and 64 bits, respectively.
|
Float is 32 bits, double is 64 bits. Floating point arithmetic and data formats are defined by IEEE754.
|
Characters are given by 16bit Unicode charset and represented as short integers.
|
One can use casts such as longint = (long) i;
|
Arrays are "true" or "first class" objects in Java and no pointer arithmetic is supported. Hence, arrays are handled as all other composite objects and its special role is due only to some syntactic sugar inherited from C/C++.
|