Last Updated : 11 Jul, 2025
Byte classis a
wrapper classfor 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:
public static final byte MAX_VALUEUsage:
Byte.MAX_VALUEReturn Value: It returns a byte value equal to 127. Below is the implementation of MAX_VALUE: Java
// Java code to implement
// MAX_VALUE of Byte class
class GFG {
public static void main(String[] args)
{
// byte variable
byte max_value;
// MAX_VALUE Byte class
max_value = Byte.MAX_VALUE;
// printing the MAX_VALUE
System.out.println(max_value);
}
}
public static final byte MIN_VALUEUsage:
Byte.MIN_VALUEReturn Value: It returns a byte value equal to -128. Below is the implementation of MIN_VALUE: Java
// Java code to implement
// MIN_VALUE of Byte class
class GFG {
public static void main(String[] args)
{
// byte variable
byte min_value;
// MIN_VALUE Byte class
min_value = Byte.MIN_VALUE;
// printing the MIN_VALUE
System.out.println(min_value);
}
}
public static final int SIZEUsage:
Byte.SIZEReturn Value: It returns a int value equal to 8. Below is the implementation of SIZE: Java
// Java code to implement
// SIZE of Byte class
class GFG {
public static void main(String[] args)
{
// SIZE Byte class
int output = Byte.SIZE;
// printing the output
System.out.println(output);
}
}
public static final Class<Byte> TYPEUsage:
Byte.TYPEReturn Value: It returns an Class instance representing the primitive data type byte. Below is the implementation of TYPE: Java
// Java code to implement
// TYPE of Byte class
class GFG {
public static void main(String[] args)
{
// TYPE variable of Byte class
Class<Byte> output = Byte.TYPE;
// printing the output
System.out.println(output);
}
}
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4