Home Help Java B The byte Keyword



The byte Keyword
Posted on: April 3, 2006 at 12:00 AM
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);

}


Related Tags for The byte Keyword:


More Tutorials from this section

Ask Questions?    Discuss: The byte Keyword  

Post your Comment


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

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.