chapter_5_beginning_javabook

Chapter_5_beginning_javabook

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ables consume 4 bytes of stack memory although they do not use all that memory. Figure 5-2. Different types of variables in a computer’s main memory. 5.1 Integer variables (int, short, long, byte, char) 107 Table 5-1. Variable types of Java. Type Size Storage capacity int 4 bytes 32 bits -2,147,483,648 ... 2,147,483,647 -80000000H ... 7FFFFFFFH short 2 bytes 16 bits -32,768 -8000H long 8 bytes 64 bits -9,223,372,036,854,775,808 ... 9,223,372,036,854,775,807 -8000000000000000H ... 7FFFFFFFFFFFFFFFH byte 1 byte 8 bits -128 -80H boolean 1 byte 8 bits false or true char 2 bytes 16 bits Unicode 0 ... 65535 float 4 bytes 32 bits Precision: 7 decimal digits Range: +/- 1.5e-45 ... 3.4e38a double 8 bytes 64 bits Precision: 15 decimal digits Range: +/- 5.0e-324 ... 1.7e308 memory addressb 4 bytes 32 bits Sufficient for addressing up to 4,294,967,296 bytes (4 gigabytes) of main memory. a. b. ... ... ... ... 32,767 7FFFH 127 7FH The ranges that are given here are approximate. "memory address" is not a variable type in Java. This row describes how much memory is allocated when a socalled object reference is declared....
View Full Document

This document was uploaded on 01/20/2014.

Ask a homework question - tutors are online