Byte Datatype Example Java Program
Definition
The byte data type is an 8-bit signed two's complement integer. It has a minimum value of -128 and a maximum value of 127 (inclusive). The byte data type can be useful for saving memory in large arrays.Syntax
byte varibale_name = integer_value;
Byte Datatype Example Program
class ByteDatatype{
public static void main(String[] args){
byte a=100;
byte b=-50;
System.out.println("The byte is: "+a);
System.out.println("The byte is: "+b);
}
}
Sample Output
Output is: The byte is: 100 The byte is: -50
Data Type Programs
Read More Articles
- Multiple Inheritance Using Interface Example Java Program
- Single Inheritance Example Java Program
- Multilevel Inheritance Example Java Program
- Hierarchical Inheritance Example Java Program
- Create Matrix Example Java Program
- Find all Substrings of a given string Example Java Program
- Sum Of Three Numbers Example Java Program
- Twin Prime Example Java Program
- Heap Sort Example Java Program
- Compile Time Polymorphism Example Java Program
