Use the underscore binary literal in Java
Description
The following code shows how to use the underscore binary literal.
Example
public class Main {
public static void main(String[] args) {
byte initializationSequence = (byte) 0b01_110_010;
System.out.println(initializationSequence);
byte inputValue = (byte) 0b101_11011;
System.out.println(inputValue);//from w w w . j a va 2 s .c o m
}
}
The code above generates the following result.
Home »
Java Tutorial »
Java Data Type »
Java Tutorial »
Java Data Type »