Byte

From Abap2Java

Jump to: navigation, search

Contents

ABAP

see predefined Data Type I and ABAP Dictionary Type INT1.

Java

Byte (Data Type)

Integral datatype.

Contains Integral data type
Default 0
Size 8 Bit
Range from -128 to 127
byte b = 7;
int i = 8;
b = (byte) i;

Byte (Class)

An object representation of the primitive Data Type byte is Byte.

Byte b = new Byte(7);
Byte c = new Byte("28");
byte d = c.byteValue();

The object representation is needed when using Collections e.g.

Vector v = new Vector();
byte b = 2;
v.add(new Byte(b));

See also
Data Type, casting

External links
JDK 1.4.2 Byte API
JDK 1.5.0 Byte API

Personal tools