什么是“<< =”运算符?(What is the “<<=” operator? [duplicate])
这个问题在这里已有答案:
我是Java的新学习者。 我有一个简单的使用运算符的程序,如:
public class Test { public static void leftshift(int i, int j) { i <<= j; } public static void main(String args[]) { int i = 4, j = 2; leftshift(i, j); System.out.printIn(i); } }
我运行此代码,输出为4。
我知道“<< =”是左移AND赋值运算符 。 但它是如何工作的?
This question already has an answer here:
- What does <<= operator mean in Java? 4 answers
I'm a new learner of Java. I have a simple program of using operator just like:
public class Test { public static void leftshift(int i, int j) { i <<= j; } public static void main(String args[]) { int i = 4, j = 2; leftshift(i, j); System.out.printIn(i); } }
I ran this code, the output is 4.
I know "<<=" is a Left shift AND assignment operator. But how does it work?
原文:https://stackoverflow.com/questions/19197639
最满意答案
如果要在模型上强制执行此类策略,则必须以某种方式标记环境,否则将永远无法删除。
如果您真的不喜欢marked_for_delete选项,则可以滥用环境名称字段(通过设置特殊值)作为变通方法。 这对我来说似乎更加狡猾。
If you want to enforce such a policy on your models, you have to somehow mark the environment, since you will never be able to delete one otherwise.
If you really dont like the marked_for_delete option, you may abuse the environments name field (by settings a special value) as a workaround. Which seems more hackish to me.