[ Contact ] [ Links ] [ Previous : 7 / 29 : Special Comments ] [ Up ] [ Next : 9 / 29 : Java Arrays ]

Java Data Types

Variables in Java must be objects, arrays, or one of the primitive data types

Java has 8 primitive data types
(boolean, byte, short, int, long, double, float, char)

Notes:

boolean likeeScience = true;
	/*	boolean likewise have values {true, false}
		they can never be mixed up with integer or other type
	 */
byte teeth = 32;		// bytes go from -128 to 127
if (!likeeScience) teeth = teeth - 1;
float pi = 3.141592f; 	// you need the "f" here
short classes = 0xbad;	// hexadecimal
   

See the "Links" link above to find out the sources of the proposed informations
Pascal Vuylsteker / eScience / Computer Science / ANU
Last modified: 20/4/2004
TOC - Print
Send your comments at :
<Hugh.Fisher@anu.edu.au>