Java Lesson 2: operators and expressions, java operator expressions

Source: Internet
Author: User

Java Lesson 2: operators and expressions, java operator expressions

1. modulo %. If the remainder is zero, the Division can be judged.
2. The remainder is always less than the divisor.
3. When the auto-increment operator ++ or the auto-subtraction operator is used independently, the first ++, -- last ++, and -- operations are the same.
4. First add one, then use, first use, then add one, then ++
5. Short-circuit logic. If one can be judged less, no more can be judged.
6. And & each condition must be true before the result is true.
Or | if one of the conditions is true, the result is true.
Not! Reversing the original Boolean Value
7. characters are enclosed in single quotes, and strings are enclosed in double quotes.
8. A conditional operator is also called a three-object operator and is usually used in a value assignment statement.
9. Three-object operator nesting
// Judgment conditions and conclusions
/*
* 1. Is it a person? If yes, leave it
* 2. Is it a demon? If yes, kill
* 3. Otherwise, Tai
*/
R = who = 'people '? 'Left ':
Who = 'shid '? 'Ky ':
'Ta ';
System. out. println (r );
10. All software can be summarized with three letters: IPO: Input, Process, Output

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.