Java Programming/Keywords/byte
Appearance
From Wikibooks, open books for an open world
This is the current revision of this page, as edited by Dirk Hünniger (discuss | contribs) at 13:20, 28 June 2024 (preparing for pdf generation with LaTeX). The present address (URL) is a permanent link to this version.
Revision as of 13:20, 28 June 2024 by Dirk Hünniger (discuss | contribs) (preparing for pdf generation with LaTeX)
byte
is a keyword which designates
the 8 bit signed integer primitive type.
The java.lang.Byte
class is the nominal
wrapper class when you need to store a byte
value
but an object reference is required.
Syntax:
byte
<variable-name> = <integer-value>;
For example:
Computer code
byteb=65;
or
Computer code
byteb='A';
The number 65 is the code for 'A' in ASCII.
See also: