Byte class is a wrapper class for the primitive type byte which contains several methods to effectively deal with a byte value like converting it to a string representation, and vice-versa. An object of Byte class can hold a single byte value.
Byte class offers four constants in the form of Fields. These are:
- MAX_VALUE:The MAX_VALUE is a instance variable of Byte class which is used to return the maximum byte value.
Syntax: public static final byte MAX_VALUE Usage: Byte.MAX_VALUE Return Value: It returns a byte value equal to 127. Below is the implementation of MAX_VALUE: // Java code to implement// MAX_VALUE of Byte classÂÂclassGFG {   Âpublicstaticvoidmain(String[] args)   Â{       Â// byte variable       Âbytemax_value;       Â// MAX_VALUE Byte class       Âmax_value = Byte.MAX_VALUE;       Â// printing the MAX_VALUE       ÂSystem.out.println(max_value);   Â}}Output:127 
- MIN_VALUE:The MIN_VALUE is a instance variable of Byte class which is used to return the minimum byte value.
Syntax: public static final byte MIN_VALUE Usage: Byte.MIN_VALUE Return Value: It returns a byte value equal to -128. Below is the implementation of MIN_VALUE: // Java code to implement// MIN_VALUE of Byte classÂÂclassGFG {   Âpublicstaticvoidmain(String[] args)   Â{       Â// byte variable       Âbytemin_value;       Â// MIN_VALUE Byte class       Âmin_value = Byte.MIN_VALUE;       Â// printing the MIN_VALUE       ÂSystem.out.println(min_value);   Â}}Output:-128 
- SIZE:The SIZE is a instance variable of Byte class which is used to return number of bits required to represent a byte value in binary representation (two’s complement).
Syntax: public static final int SIZE Usage: Byte.SIZE Return Value: It returns a int value equal to 8. Below is the implementation of SIZE: // Java code to implement// SIZE of Byte classÂÂclassGFG {   Âpublicstaticvoidmain(String[] args)   Â{       Â// SIZE Byte class       Âintoutput = Byte.SIZE;       Â// printing the output       ÂSystem.out.println(output);   Â}}Output:8 
- TYPE: The TYPE is a instance variable of Byte class which is used to return Class instance representing the primitive data type byte.
Syntax: public static final Class<Byte> TYPE Usage: Byte.TYPE Return Value: It returns an Class instance representing the primitive data type byte. Below is the implementation of TYPE: // Java code to implement// TYPE of Byte classÂÂclassGFG {   Âpublicstaticvoidmain(String[] args)   Â{       Â// TYPE variable of Byte class       ÂClass<Byte> output = Byte.TYPE;       Â// printing the output       ÂSystem.out.println(output);   Â}}Output:byte 


 
                                    







