Basic HTML version of Foils prepared Sept 21 1998

Foil 7 Primitive Types

From Java Tutorial 98- 2: Java Language and Object Oriented Techniques NAVO Tutorial -- Sept 23 1998. by Geoffrey C. Fox, Nancy McCracken

An example application summing numbers.
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 standard.
characters are given by 16bit Unicode charset and represented as short integers.
One can use casts for conversion such as
  • long l;
  • l = (long) i;
  • // which can be explicit as here and sometimes implied (see later)
Note booleans are either TRUE or FALSE -- they are not 0, 1 ,-1 ...



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sat Nov 28 1998