Why are there no binary literals in Java?

后端 未结 6 926
花落未央
花落未央 2020-12-17 09:15

Is there any particular reason why this kind of literal is not included whereas hex and octal formats are allowed?

6条回答
  •  既然无缘
    2020-12-17 09:39

    Java 7 includes it.Check the new features.

    Example:

    int binary = 0b1001_1001;
    

提交回复
热议问题