Java examples for Language Basics:Primitive Types
Using underscores with binary literals
public class Main { public static void main(String[] args) { byte initializationSequence = (byte) 0b01_110_010; byte inputValue = (byte) 0b101_11011; byte result = (byte) (inputValue & (byte) 0b000_11111); System.out.println("initializationSequence: " + Integer.toBinaryString(initializationSequence)); System.out.println("result: " + Integer.toBinaryString(result)); }// w ww.j av a 2 s . co m }