In Java, the byte keyword is used to declared a variable as a numeric type. A byte value can hold an 8-bit integer number which ranges from -128 to 127. For example:

byte month = 6;

The byte keyword can be used to declared return type of a method as well:

public byte getMonth() {
    return 12;
}

See all keywords in Java.

 

Related Topics:

 

Other Recommended Tutorials:


About the Author:

is certified Java programmer (SCJP and SCWCD). He started programming with Java in the time of Java 1.4 and has been falling in love with Java since then. Make friend with him on Facebook and watch his Java videos you YouTube.



Add comment