Share on Google+Share on Google+

The byte Keyword

The byte Java Keyword defines the 8-bit integer primitive type.

The byte Keyword


The byte Java Keyword defines the 8-bit integer primitive type. 

The keyword byte in Java is a primitive type that designates with eight bit signed integer  in java primitive type. In java keyword byte will be stored as an integer value between the range −128 to 127. 

The class ( java.lang.Byte) will be required as nominal wrapper class in that we need to store the byte value but  the object reference is needed. 

The byte class that is a wrapper class for byte primitive type and that also defines min and max values represent range of values for this type.

Syntact: Syntact of byte  Keyword

   byte <variable-name> = <integer-value>;

Here is an example:

public class Main {

public static void main(String[] args) {

byte sun= -12;
System.out.print("sun: ");




Posted on: April 3, 2006 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Discuss: The byte Keyword  

Post your Comment

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image