Home  >  Article  >  Java  >  How to type the 'or' symbol in java

How to type the 'or' symbol in java

angryTom
angryTomOriginal
2020-02-04 10:25:4525747browse

How to type the 'or' symbol in java

How to type the "or" symbol in java

In the English input method, press and hold the shift key and then Press right underline (the key between the backspace key and the enter key).

There are two "or"s:

1. | The expression will be judged before and after.

if(a==0 | b==0) // a==0与b==0,都会进行判断是真还是假

2. || has a short-circuit function. If the previous one is true, it will no longer be Determine the following expression

if(a==0 || b==0) // 如果a==0为真,那么就不再判断b==0是否为真,而直接执行下面的语句,如果a==0为假,才判断b==0是否为真

Recommended related articles and tutorials: java introductory tutorial

The above is the detailed content of How to type the 'or' symbol in java. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn