<分区>
Possible Duplicate:
What is the following sign: <<?
有人可以解释一下示例代码中的 << 吗?
final static public int MY_VAR = 1<<3;
谢谢!
<分区>
Possible Duplicate:
What is the following sign: <<?
有人可以解释一下示例代码中的 << 吗?
final static public int MY_VAR = 1<<3;
谢谢!
最佳答案
当然,这是一个 left shift - 您将数字“1”左移 3 位,因此结果将为 8。
参见 section 15.19 Java 语言规范的详细信息。
关于Java << 运算符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7243592/