Java中的AND和OR [英] AND and OR in Java

查看:770
本文介绍了Java中的AND和OR的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好兄弟,


请告诉我如何在java中使用AND和OR。


谢谢

解决方案


各位兄弟,


请介绍一下如何使用AND和java中的OR。


谢谢



Java中没有AND和OR这样的东西。有&,&&,|和||相反

他们是二元运算符。


&和|运算符在任何整数域上运行,它们与''按位 - 和''和''按位或''运算符和布尔域相同的目的服务于



&&和||运算符仅在布尔域上运行,并且当从左操作数结束答案时,不要评估正确的操作数。


亲切的问候,


Jos



各位兄弟,


请告诉我如何在java中使用AND和OR。


谢谢



那些既不是Java关键字也不是有效的运算符。

如果你想为AND和OR使用正确的Java运算符,那么只需谷歌它们或参考Java教科书。


< blockquote class =post_quotes>
Java中没有AND和OR这样的东西。有&,&&,|和||相反

他们是二元运算符。


&和|运算符在任何整数域上运行,它们与''按位 - 和''和''按位或''运算符和布尔域相同的目的服务于



&&和||运算符仅在布尔域上运行,并且当从左操作数结束答案时,不要评估正确的操作数。


亲切的问候,


Jos



我的,我的。这是什么时候?


Hi all brothers,

Please give me some idea how to use AND and OR in java.

Thanks

解决方案

Hi all brothers,

Please give me some idea how to use AND and OR in java.

Thanks

There are no such things as AND and OR in Java. There are &, &&, | and || instead
and they''re binary operators.

The & and | operators operate on both any integral domain where they serve the
same purpose as ''bitwise-and'' and ''bitwise-or'' operators and the boolean domain.

The && and || operators operate on just the boolean domain and don''t evaluate
the right operand when the answer can be ''concluded'' from the left operand.

kind regards,

Jos


Hi all brothers,

Please give me some idea how to use AND and OR in java.

Thanks

Those are neither Java keywords nor valid operators.
If you want the correct Java operators for AND and OR then just google them or refer to a Java textbook.


There are no such things as AND and OR in Java. There are &, &&, | and || instead
and they''re binary operators.

The & and | operators operate on both any integral domain where they serve the
same purpose as ''bitwise-and'' and ''bitwise-or'' operators and the boolean domain.

The && and || operators operate on just the boolean domain and don''t evaluate
the right operand when the answer can be ''concluded'' from the left operand.

kind regards,

Jos

My, my. What''s the occasion?


这篇关于Java中的AND和OR的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆