Java Arithmetic operators

Source: Internet
Author: User
Tags arithmetic operators logical operators

Arithmetic operators

+,-,*(multiplication sign),/(division sign, pick-up),%(take remainder, modulo)

Special operators: ++ ( gaga ) , -- ( minus )

int a = 1;

a+=10; equivalent to a=a+10;

a-=5; equivalent to a=a-5;

int a = 1;

Scene 1:system.out.print (a++);//Output 1

int a = 1;

Scene 2:system.out.print (++a);//Output 2

Relational operators

Greater than:> less than:< greater than or equal to:>= less than equals:<= equals sign:= = Not equal to: /c6>!=

logical operators

L && Logic and (press shift+7)--and (and, at the same time)

Multiple conditions, 1 are false, if () all false, multiple conditions are true at the same time, if () is true

L | | (Press shift+ to enter the above |) -or (OR)

Multiple conditions, as long as 1 are true, if () all is true

! (in English state)--take the inverse not equal to! =

Java Arithmetic operators

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.