Top
Previous Next
The Java Language CS 161 - Java

Primitive Numeric Integer Types

Memory

Type
byte   
short      
int            
long                        

Details

TypeSizeMin valueMax value
byte8 bits-128127
short16 bits-3276832767
int32 bits-21474836482147483647
long64 bits-92233720368547758089223372036854775807

Example

int answer = 42;
long aLongValue = 5875685732167641L;  // note 'L'
short sval = 32766;
byte bval = -101;

Top
Previous Next
jwd