Basic HTML version of Foils prepared May 12 1996

Foil 41 Java Language -- Variable/Expression Types

From CRPC Lectures on Java Language Applets Graphics CRPC Annual Meeting Tutorial -- May 14,1996. by Geoffrey C. Fox


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++.

in Table To:


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 Sun Dec 14 1997