Home  >  Article  >  Java  >  How to type the "and" symbol in java

How to type the "and" symbol in java

angryTom
angryTomOriginal
2020-02-10 12:42:248153browse

How to type the

How to type the "amers" symbol in java

Use the "ampersand" symbol on the keyboard in javaShift The number 7 can be typed out. (Not the number 7 on the small keyboard)

&& in Java can be used as a logical AND operator to represent logical AND (and). When the results of the expressions on both sides of the operator are true, the entire operation The result is true, otherwise, as long as one party is false, the result is false.

Usage example:

int a = 1;
String b = "abc";
if(a && b) {
    System.out.println("a 和 b都为真")
}

(Related video tutorial sharing: java video tutorial)

Knowledge expansion: The difference between & and &&

"&" Regardless of whether the first judgment condition is true, the two conditions before and after the logical operator will be judged;
"&&", if the first condition is not true, the subsequent conditions will not be judged; the first condition Established, continue to judge the second condition.

The above is the detailed content of How to type the "and" 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