等效于C ++移位运算符<<在Java中? [英] Equivalent of C++ shift operator << in Java?
本文介绍了等效于C ++移位运算符<<在Java中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
C ++移位运算符<<
不循环.例如,如果您这样做:
C++ shift operator <<
does not cycle. For example if you do:
// C++
int a = 1;
cout << (a<<38);
您获得0.但是,在Java中,您实际上循环并获得了有效值64.
You get 0. But, in Java you actually cycle and get a valid value of 64.
我需要将一些C ++代码转换为Java,所以我怎么用等价于<<
?
I need to translate some C++ code to Java, so what do I use as the equivalent for <<
?
推荐答案
查看全文