1 |
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 ...
|
2 |
There are 4 integer types: byte, short, int, long of size 8, 16, 32 and 64 bits, respectively.
|
3 |
Float is 32 bits, double is 64 bits. Floating point arithmetic and data formats are defined by IEEE754.
|
4 |
Characters are given by 16bit Unicode charset and represented as short integers.
|
5 |
One can use casts such as longint = (long) i;
|
6 |
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++.
|