Some primitive data types available in Java
As well as having an identifier (name),
variables have a type. We have already encountered `int' (an integer). Below is a list of
the most important primitive types. By primitive it is meant 'built into the language'.
- int: an integer.
- float, double: approximate real numbers.
- char: a single character.
- byte: a byte.
- boolean: true or false.
A quick recap of some high school mathematics:
an integer is a whole number (e.g., 3, 0, -1000) and a real number is one that can have a
fractional component (e.g., 3.1, -32.6)
Back
to top
. 
RITSEC - Global Campus
Copyright ?1999 RITSEC- Middlesex University. All rights reserved.
webmaster@globalcampus.com.eg
|