集册 Java实例教程 下划线与二进制文字一起使用

下划线与二进制文字一起使用

欢马劈雪     最近更新时间:2020-01-02 10:19:05

618
提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
下划线与二进制文字一起使用
public class Main {
/* from 
时 代 J a v a - N o w J a v a . c o m*/

  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));


  }

}