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: ");
System.out.print(sun);

}


Advertisements

Share on Google+Share on Google+

The byte Keyword

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

Advertisements

 

Discuss: The byte Keyword  

Post your Comment


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

Ads

 

Ads