Java Reference
In-Depth Information
creating code and data portability problems. Java attempts to deal with these prob-
lems by explicitly prescribing these data types and how they are to be defined and
implemented across systems.
Type
Description
No.
Range Equivalent
COBOL
of Bits
boolean
True or false
1
N/A
TRUE, FALSE
char
Unicode
16
x'0000' to 'xFFFF'
N/A
character
byte
Signed integer
8
-128 to 127
PIC X 1
short
Signed integer
16
-32768 to 32767
PIC S9(4) BINARY 2
int
Signed integer
32
-2147483648
PIC S9(9) BINARY
to 2147483647
long
Signed integer
64
-9223372036854775808
PIC S9(18) COMP-4 3
to 9223372036854775807
PIC S9(18) COMP-5
float
IEEE754
32
+/-3.40282347E+38
USAGE IS FLOAT 4
number
to +/-1.40239846E-45
double
IEEE754
64
+/-1.79769313486231570E+308 -
USAGE IS DOUBLE 4
number
+/-4.94065645841246544E-324
1. Most COBOL compilers handle single-byte characters as unsigned, that is, with values between 0 and +255.
2. Some COBOL compilers define BINARY as COMP-4 or COMP-5. Only values with four digits (-9999 through
9999) are guaranteed to fit in an integer of this size.
3. The range of valid values may be limited on some compilers to those that fit in 18 digits.
4. Supported by some compilers.
These next types are not intrinsic Java types, but instead are some of the stan-
dard classes that are commonly used in Java programs.
 
Search WWH ::




Custom Search